I already have read the documentation of Node.js and, unless if I missed something, it does not tell what the parameters contain in certain operations, in particular fs.mkdi
If you want a quick-and-dirty one liner, use this:
fs.existsSync("directory") || fs.mkdirSync("directory");