fs-force-write-file
v1.0.1
Published
Just provide a path to create a file
Downloads
2
Maintainers
Readme
fs-force-write-file
Requirements
- Node >= 6.0.0
Usage
var writeFile = require('fs-force-write-file');
writeFile('./a/b/c/d', 'Hello, World!!', (error, info) => {
if (error) {
console.error('Failed', error);
} else {
console.log('Succeed', info);
}
});
The code above would:
- First, do
force-mkdir
to create a directory'./a/b/c'
- Then, do
fs.writeFile
to create file'./a/b/c/d'
with content'Hello, World!!'