Package Exports
- mz-modules
- mz-modules/glob
- mz-modules/mkdirp
- mz-modules/pump
- mz-modules/rimraf
- mz-modules/sleep
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 (mz-modules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mz-modules
Same as mz, but wrap many popular modules rather than core API.
Node require >= 4.0.0
Usage
Install it
$ npm i mz-modulesRequire 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.
Modules
mz-modules/mkdirpwrapped mkdirpmz-modules/rimrafwrapped rimrafmz-modules/globwrapped globmz-modules/sleepwrapped ko-sleepmz-modules/nextTickwrapped process.nextTickmz-modules/setImmediatewrapped setImmediatemz-modules/pumpwrapped pump
Contribute
You can request adding module to mz-modules
- Create a issue let us know why you want to add the module.
- Add a module, named
xx
- create
xx.jsthat exports a function should return promise. - require
xx.jsinindex.js - add a testcase for it in
test/xx.test.js - add xx.js to files in
package.json
- Create a pull request