[Bluebird's promise] version of mkdirp:
Like mkdir -p, but in node.js!
npm install --save mkdirp-bluebirdconst mkdirp = require('mkdirp-bluebird')pattern: String
options: Object or String
Return: Object (Promise)
When it finishes, it will be fulfilled with the first directory made that had to be created, if any.
When it fails, it will be rejected with an error as its first argument.
mkdirp('/tmp/foo/bar/baz')
.then(function (made) {
console.log(made) //=> '/tmp/foo'
})
.catch(function (err) {
console.error(err)
})
})The option object will be directly passed to mkdirp.
Thanks Ahmad Nassri for the sources of mkdirp-promise