convenience extension of fs
npm install exfs
This package has original functions in fs
. So, you can use this package as below.
var fs = require("exfs");
//you can use fs as original usage.
Asynchronously make directory if directory isn't exist
When the directory in which new folder will be made is not exist, if createFlag=true
, this function make it. if createFlag=false
, this function throw an error.
var fs = require("exfs");
fs.mkdir("./you/can/make/this/very/very/deep/directory/at/a/time", callback, true);
Asynchronously writes data to a file
When the directory in which file is made is not exist, if createFlag=true
, this function make it. if createFlag=false
, this function throw an error.
var fs = require("exfs");
var path = ("./you/can/make/this/very/very/deep/directory/at/a/time");
fs.writeFile(path, "Hello World!", callback, true);