| 
				
					 | 
			před 2 roky | |
|---|---|---|
| .. | ||
| lib | před 2 roky | |
| node_modules | před 2 roky | |
| History.md | před 2 roky | |
| LICENSE | před 2 roky | |
| README.md | před 2 roky | |
| glob.js | před 2 roky | |
| index.js | před 2 roky | |
| mkdirp.js | před 2 roky | |
| nextTick.js | před 2 roky | |
| package.json | před 2 roky | |
| pump.js | před 2 roky | |
| rimraf.js | před 2 roky | |
| setImmediate.js | před 2 roky | |
| sleep.js | před 2 roky | |
Same as mz, but wrap many popular modules rather than core API.
Node require >= 4.0.0
Install it
$ npm i mz-modules
Require it
const mkdirp = require('mz-modules/mkdirp');
You can also require it from the main entry, but it will load other modules in mz-modules.
const mkdirp = require('mz-modules').mkdirp;
Use it
// Using promise
mkdirp('/path/to/dir').then(() => console.log('done'));
// Or if you are using async function
async function doSomething() {
  await 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.jstest/xx.test.jspackage.json