Skip to content

ksxnodemodules/fs-force-write-file-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!!'

License

MIT © Hoàng Văn Khải