All Projects → ahmadnassri → mkdirp-promise

ahmadnassri / mkdirp-promise

Licence: ISC license
Promise version of mkdirp

Programming Languages

javascript
184084 projects - #8 most used programming language

mkdirp-promise version License

⚠️ This package is broken and no longer maintained

mkdirp (which this package was wrapping) itself supports promises now, please switch to that

Or, if you're using the latest Node.js version, fs.mkdir also supports recursive mode and returns promises

Promise version of mkdirp:

Like mkdir -p, but in node.js!

Install

npm install --only=production --save mkdirp-promise

API

const mkdirp = 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) //=> '/tmp/foo'
  .catch(console.error)

options

The option object will be directly passed to mkdirp.


©️ ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].