A simple extension of mkdirp with brace-expansion to create multi-level & recursive folders.
0.5.1
node-folder
will return (native) Promise. Please make sure your node version supports ES6.
npm install --save node-folder
var folder = require('node-folder');
folder('{dir1/{sub1,sub2,sub3/child{1..5}},dir2}');
or
var folder = require('node-folder');
folder('{dir1/{sub1,sub2,sub3/child{1..5}},dir2}')
.then(function(success) {
// your success story
})
.catch(function(err) {
// your not so success story
})
var folder = require('node-folder');
function scaffold() {
// Make sure you return the Promise or otherwise you'll get a warning
// The following tasks did not complete: scaffold
// Did you forget to signal async completion?
return (folder('{dir1/{sub1,sub2,sub3/child{1..5}},dir2}'));
}
For more examples, please refer test
file.
:/> node-folder {dir1/{sub1,sub2,sub3/child{1..5}},dir2}