Node.js create folder or use existing

后端 未结 14 1460
暖寄归人
暖寄归人 2020-12-04 06:43

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

14条回答
  •  感动是毒
    2020-12-04 07:26

    If you want a quick-and-dirty one liner, use this:

    fs.existsSync("directory") || fs.mkdirSync("directory");
    

提交回复
热议问题