GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - node-modules/mz-modules: Same as `mz`, but wrap modules in the world rather than core API.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
test
test
 
 
.autod.conf.js
.autod.conf.js
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
History.md
History.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
glob.js
glob.js
 
 
index.js
index.js
 
 
mkdirp.js
mkdirp.js
 
 
nextTick.js
nextTick.js
 
 
package.json
package.json
 
 
pump.js
pump.js
 
 
rimraf.js
rimraf.js
 
 
setImmediate.js
setImmediate.js
 
 
sleep.js
sleep.js
 
 

Repository files navigation

mz-modules

Same as mz, but wrap many popular modules rather than core API.

NPM version Test coverage Known Vulnerabilities npm download

Node require >= 4.0.0

Usage

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.

Modules

  • mz-modules/mkdirp wrapped mkdirp
  • mz-modules/rimraf wrapped rimraf
  • mz-modules/glob wrapped glob
  • mz-modules/sleep wrapped ko-sleep
  • mz-modules/nextTick wrapped process.nextTick
  • mz-modules/setImmediate wrapped setImmediate
  • mz-modules/pump wrapped pump

Contribute

You can request adding module to mz-modules

  1. Create a issue let us know why you want to add the module.
  2. Add a module, named xx
  • create xx.js that exports a function should return promise.
  • require xx.js in index.js
  • add a testcase for it in test/xx.test.js
  • add xx.js to files in package.json
  1. Create a pull request

License

MIT

About

Same as `mz`, but wrap modules in the world rather than core API.

Topics

async-awaitmzpromise

Resources

Readme
License
Activity
Custom properties

Stars

55 stars

Watchers

12 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.