A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
AJ ONeal 2b252af831 v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
.gitignore v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
LICENSE v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
README.md v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
example.js v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
mkdirp.js v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
package.json v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans
test.js v1.0.0: A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node il y a 5 ans

README.md

mkdirp.js | A Root Project

A zero-dependency, Promise-friendly mkdirp written in VanillaJS for node.

Install

npm install --save @root/mkdirp

Usage

'use strict';

var mkdirp = require('@root/mkdirp')
mkdirp('/path/to/whatever', function (err) {
  if (err) { throw err; }
  console.log("directory now exists");
});

Usage (Promise)

'use strict';

var util = require('util');
var mkdirp = util.promisify(require('@root/mkdirp'));

mkdirp('/path/to/whatever').then(function () {
  console.info("directory now exists");
}).catch(function (err) {
  console.error(err);
});

Why not substack's mkdirp?

We're serious about light, zero-dependency JavaScript.

Fewer dependencies means code that's more easily audited, and less surface area for attacks.

substack's implementation is excellent and well-tested, but it's not Promise / await friendly and it depends on minimist, which isn't necessary because we don't need the commandline usage.