# mz-modules

> modernize node.js modules to current ECMAScript standards

Latest version **2.1.0** (published 2018-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install mz-modules
pnpm add mz-modules
yarn add mz-modules
bun add mz-modules
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-02-13 |
| First published | 2017-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 5 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55 |
| Author | popomore |
| Maintainers | fengmk2, popomore |

## Links

- npm: https://www.npmjs.com/package/mz-modules
- Repository: https://github.com/node-modules/mz-modules
- Homepage: https://github.com/node-modules/mz-modules#readme
- Issues: https://github.com/node-modules/mz-modules/issues
- npm.io page: https://npm.io/package/mz-modules

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.2
- [pump](https://npm.io/package/pump.md) ^3.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.1
- [ko-sleep](https://npm.io/package/ko-sleep.md) ^1.0.3

## Recent versions

- 2.1.0 (latest) — 2018-02-13
- 2.0.0 — 2017-08-23
- 1.0.0 — 2017-02-09

## README

# mz-modules

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

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/mz-modules.svg?style=flat-square
[npm-url]: https://npmjs.org/package/mz-modules
[travis-image]: https://img.shields.io/travis/node-modules/mz-modules.svg?style=flat-square
[travis-url]: https://travis-ci.org/node-modules/mz-modules
[codecov-image]: https://codecov.io/gh/node-modules/mz-modules/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/node-modules/mz-modules
[david-image]: https://img.shields.io/david/node-modules/mz-modules.svg?style=flat-square
[david-url]: https://david-dm.org/node-modules/mz-modules
[snyk-image]: https://snyk.io/test/npm/mz-modules/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/mz-modules
[download-image]: https://img.shields.io/npm/dm/mz-modules.svg?style=flat-square
[download-url]: https://npmjs.org/package/mz-modules

Node require `>= 4.0.0`

## Usage

Install it

```bash
$ npm i mz-modules
```

Require it

```js
const mkdirp = require('mz-modules/mkdirp');
```

You can also require it from the main entry, but it will load other modules in mz-modules.

```js
const mkdirp = require('mz-modules').mkdirp;
```

Use it

```js
// 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](https://github.com/node-modules/mz-modules/issues) let us know why you want to add the module.
1. 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](LICENSE)

[mz]: https://github.com/normalize/mz
[mkdirp]: https://github.com/substack/node-mkdirp
[rimraf]: https://github.com/isaacs/rimraf
[ko-sleep]: https://github.com/alsotang/ko-sleep
[glob]: https://github.com/isaacs/node-glob
[pump]: https://github.com/mafintosh/pump

---
_Source: https://npm.io/package/mz-modules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
