JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 849269
  • Score
    100M100P100Q56124F
  • License ISC

Promise version of mkdirp

Package Exports

  • mkdirp-promise
  • mkdirp-promise/lib/node4

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mkdirp-promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mkdirp-promise version License

Promise version of mkdirp:

Like mkdir -p, but in node.js!

Build Status Downloads Code Climate Coverage Status Dependencies

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.

/*
 * Node 6
 * Built using `babel-preset-es2015-node6`
 */
const mkdirpPromise = require('mkdirp-promise/lib/node6')

/*
 * Node 5
 * Built using `babel-preset-es2015-node5`
 */
const mkdirpPromise = require('mkdirp-promise/lib/node5')

/*
 * Node 4
 * Built using `babel-preset-es2015-node4`
 */
const mkdirpPromise = require('mkdirp-promise/lib/node4')

/*
 * Node >=0.10 <=0.12
 * Built using `babel-preset-es2015`
 * Note: 
 *   - additional package is required: `babel-runtime`
 *   - npm install --production --save babel-runtime
 */
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) //=> '/tmp/foo'
  .catch(console.error)

options

The option object will be directly passed to mkdirp.


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