Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mz-modules

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mz-modules

modernize node.js modules to current ECMAScript standards

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
decreased by-10.67%
Maintainers
2
Weekly downloads
 
Created
Source

mz-modules

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

NPM version build status Test coverage David deps 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

FAQs

Package last updated on 13 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc