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