mkdirp-promise
Promise version of mkdirp:
Like mkdir -p, but in node.js!
Install
npm install --production --save mkdirp-promise
Usage
I reccomend using an optimized build matching your Node.js environment version, otherwise, the standard require
would work just fine.
const mkdirpPromise = require('mkdirp-promise/lib/node6')
const mkdirpPromise = require('mkdirp-promise/lib/node5')
const mkdirpPromise = require('mkdirp-promise/lib/node4')
var mkdirpPromise = require('mkdirp-promise')
API
const mkdirpPromise = require('mkdirp-promise')
mkdirp(dir, [, options])
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(console.log)
.catch(console.error)
options
The option object will be directly passed to mkdirp.
:copyright: www.ahmadnassri.com ·
License: ISC ·
Github: @ahmadnassri ·
Twitter: @ahmadnassri