Like fs.createWriteStream, but it will create the needed directories before trying to create the file.
npm install safe-write-stream
var safeWriteStream = require('safe-write-stream'); fs.createReadStream('file.txt') .pipe(safeWriteStream(__dirname+'/these/will/be/created/file.txt'))
See the fs.createWriteStream docs.
Combine open-source packages with your private code and publish to a private registry behind the firewall. npm ♥ enterprise developers
how? learn more