FS Wishlist
Mixins for the Node.JS file system adding the functionality we wish it had.
Usage
mixin(fs, [options])
Mixin an implementation of the file system interface.
Options
- mixins
Object
Optional enables/disables mixins- mkdirp
Boolean
Optional Default:true
Controls whether fs.mkdirp(path[, callback])) is mixed in. - rmdirp
Boolean
Optional Default:true
Controls whether fs.rmdirp(path[, callback])) is mixed in. - readdirp
Boolean
Optional Default:true
Controls whether fs.readdirp(path[, callback])) is mixed in. - copyDir
Boolean
Optional Default:true
Controls whether fs.copyDir(sourcePath, destinationPath[, callback])) is mixed in.
- mkdirp
var fsWishlist = ;var fs = ;var xfs = fsWishlist; xfs;
replace([options])
Replace the fs
module with an already mixed in vesion of fs
.
Options
- mixins
Object
Optional enables/disables mixins- mkdirp
Boolean
Optional Default:true
Controls whether fs.mkdirp(path[, callback])) is mixed in. - rmdirp
Boolean
Optional Default:true
Controls whether fs.rmdirp(path[, callback])) is mixed in. - readdirp
Boolean
Optional Default:true
Controls whether fs.readdirp(path[, callback])) is mixed in. - copyDir
Boolean
Optional Default:true
Controls whether fs.copyDir(sourcePath, destinationPath[, callback])) is mixed in.
- mkdirp
; var fs = ;fs;
Mixins
For all methods callbacks are optional, if provided they will be used otherwise a promise will be returned.
fs.mkdirp(path[, mode][, callback])
Recursively create directories if they don't exist.
var xfs = ; xfs;
fs.rmdirp(path[, callback])
Recursively removes the given directory.
var xfs = ; xfs;
fs.readdirp(path[, callback])
Recursively reads the given directory.
var xfs = ; xfs;
fs.copyDir(sourcePath, destinationPath[, callback])
Recursively copies the contents of a directory to the destination, creates the destination directories if they do not exist. This overwrites the files if they already exist, and directories themselves are not copied but instead a new directory is created of the same name.
var xfs = ; xfs;