Create Directory When Writing To File In Node.js

前端 未结 9 1409
情话喂你
情话喂你 2021-01-30 09:44

I\'ve been tinkering with Node.js and found a little problem. I\'ve got a script which resides in a directory called data. I want the script to write some data to

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-30 10:21

    I just published this module because I needed this functionality.

    https://www.npmjs.org/package/filendir

    It works like a wrapper around Node.js fs methods. So you can use it exactly the same way you would with fs.writeFile and fs.writeFileSync (both async and synchronous writes)

提交回复
热议问题