enfsmkdirp
Module that add list functionality to node fs module
enfs stands for [E]asy [N]ode [fs]
Description
This module will add a method that allows the creation o directories
and sub-directories with one command line. Add mkdir -p functionality to node fs module
- This module will add following methods to node fs module:
Usage
enfsmkdirp
var enfsmkdirp = require("esnofsmkdirp");
Errors
All the methods follows the node culture.
- Async: Every async method returns an Error in the first callback parameter
- Sync: Every sync method throws an Error.
Additional Methods
mkdirp
- mkdirp(path, [options], callback)
Asynchronously create multiple directories levels
path
The path can be on the form of a string, an array or "brace-string"
[options]:
- fs (Object): an alternative fs module to use (default will be enfspatch)
- mode (String or Number): the mode that will be attributed to the directory being created
enfsmkdirp.mkdirp("/home/path/to/folder", function(err){
});
enfsmkdirp.mkdirp(["/home/path/to/folder","/var/home/test"], function(err){
});
enfsmkdirp.mkdirp("./project/{development,production}/{public,css,private,test}", function(err){
});
mkdirpSync
- mkdirpSync(path, [options])
Synchronously create multiple directories levels
path
The path can be on the form of a string, an array or "brace-string"
[options]:
- fs (Object): an alternative fs module to use (default will be enfspatch)
- mode (String or Number): the mode that will be attributed to the directory being created
enfsmkdirp.mkdirpSync("/home/path/to/folder");
enfsmkdirp.mkdirpSync(["/home/path/to/folder","/var/home/test"]);
enfsmkdirp.mkdirpSync("./project/{development,production}/{public,css,private,test}");
License
Creative Commons Attribution 4.0 International License
Copyright (c) 2016 Joao Parreira joaofrparreira@gmail.com GitHub
This work is licensed under the Creative Commons Attribution 4.0 International License.
To view a copy of this license, visit CC-BY-4.0.