fs-enhance
extend file system apis for some more complex operation, more info
Installation
npm install -g fs-enhance
API
fsEnhance.copyFile
copy file
parameter:
src
:String
source file pathtarget
:String
target file pathcb
:Function
the callback for error occur
example:
var fsEnhance = ; fsEnhance;
fsEnhance.mkdir
create folders in folder path, is similar to mkdir -p aaa/bbb/ccc
parameter:
dirpath
:String
source folder pathmode
:String|Number
folder's file mode, mode defaults to 0777
example:
var fsEnhance = ; fsEnhance;
fsEnhance.readDir
traversal folder then excute the callback
parameter:
src
:String
source file pathcb
:Function
the callback for each file or folder
//cb's arguments path: filePath //file's real path type: 1|0 //file's type 1: file 0: folder
example:
var fsEnhance = ; fsEnhance;