If I use fs.writeFile I get:
Error: ENOENT, No such file or directory
I think that's because the directories that houses the file doesn't exist.
Am I supposed to use fs.mkdir first or is there something else?
Thanks.
If I use fs.writeFile I get:
Error: ENOENT, No such file or directory
I think that's because the directories that houses the file doesn't exist.
Am I supposed to use fs.mkdir first or is there something else?
Thanks.
Node.js lacks a recursive directory creator in the core API.
Someone is yet to make something equivalent to Perl's File::Path, but here's at least a recursive creator in Node:
https://github.com/isaacs/npm/blob/master/lib/utils/mkdir-p.js
Edit:
This is probably easier to use: https://github.com/bpedro/node-fs