Name: mz-modules
Owner: node_modules
Description: Same as `mz`, but wrap modules in the world rather than core API.
Created: 2017-02-08 04:39:28.0
Updated: 2018-04-17 00:33:37.0
Pushed: 2018-02-13 03:31:01.0
Size: 11
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Same as mz, but wrap many popular modules rather than core API.
Node require >= 4.0.0
Install it
m i mz-modules
Require it
t mkdirp = require('mz-modules/mkdirp');
You can also require it from the main entry, but it will load other modules in mz-modules.
t mkdirp = require('mz-modules').mkdirp;
Use it
sing promise
rp('/path/to/dir').then(() => console.log('done'));
r if you are using async function
c function doSomething() {
ait mkdirp('/path/to/dir');
Warning: nextTick and setImmediate is little slower than callback, because promise queue is after nextTick.
mz-modules/mkdirp
wrapped mkdirpmz-modules/rimraf
wrapped rimrafmz-modules/glob
wrapped globmz-modules/sleep
wrapped ko-sleepmz-modules/nextTick
wrapped process.nextTickmz-modules/setImmediate
wrapped setImmediatemz-modules/pump
wrapped pumpYou can request adding module to mz-modules
xx
xx.js
that exports a function should return promise.xx.js
in index.js
test/xx.test.js
package.json