{"id":13432411,"url":"https://github.com/normalize/mz","last_synced_at":"2025-03-16T23:31:16.836Z","repository":{"id":16805219,"uuid":"19564078","full_name":"normalize/mz","owner":"normalize","description":"modernize node.js to current ECMAScript standards","archived":false,"fork":false,"pushed_at":"2020-12-11T13:09:34.000Z","size":41,"stargazers_count":1380,"open_issues_count":15,"forks_count":44,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-10T02:07:34.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/normalize.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-08T07:09:15.000Z","updated_at":"2024-11-21T15:54:41.000Z","dependencies_parsed_at":"2022-07-26T09:02:11.849Z","dependency_job_id":null,"html_url":"https://github.com/normalize/mz","commit_stats":null,"previous_names":["normalize/mdz"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalize%2Fmz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalize%2Fmz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalize%2Fmz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normalize%2Fmz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/normalize","download_url":"https://codeload.github.com/normalize/mz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243579262,"owners_count":20313998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:11.258Z","updated_at":"2025-03-16T23:31:16.522Z","avatar_url":"https://github.com/normalize.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Repository"],"sub_categories":["Control flow"],"readme":"\n# MZ - Modernize node.js\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nModernize node.js to current ECMAScript specifications!\nnode.js will not update their API to ES6+ [for a while](https://github.com/joyent/node/issues/7549).\nThis library is a wrapper for various aspects of node.js' API.\n\n## Installation and Usage\n\nSet `mz` as a dependency and install it.\n\n```bash\nnpm i mz\n```\n\nThen prefix the relevant `require()`s with `mz/`:\n\n```js\nvar fs = require('mz/fs')\n\nfs.exists(__filename).then(function (exists) {\n  if (exists) // do something\n})\n```\n\nWith ES2017, this will allow you to use async functions cleanly with node's core API:\n\n```js\nconst fs = require('mz/fs')\n\n\nasync function doSomething () {\n  if (await fs.exists(__filename)) // do something\n}\n```\n\n## Promisification\n\nMany node methods are converted into promises.\nAny properties that are deprecated or aren't asynchronous will simply be proxied.\nThe modules wrapped are:\n\n- `child_process`\n- `crypto`\n- `dns`\n- `fs` (uses `graceful-fs` if available)\n- `readline`\n- `zlib`\n\n```js\nvar exec = require('mz/child_process').exec\n\nexec('node --version').then(function (stdout) {\n  console.log(stdout)\n})\n```\n\n## Promise Engine\n\n`mz` uses [`any-promise`](https://github.com/kevinbeaty/any-promise).\n\n## FAQ\n\n### Can I use this in production?\n\nYes, Node 4.x ships with stable promises support. For older engines,\nyou should probably install your own promise implementation and register it with\n`require('any-promise/register')('bluebird')`.\n\n### Will this make my app faster?\n\nNope, probably slower actually.\n\n### Can I add more features?\n\nSure.\nOpen an issue.\n\nCurrently, the plans are to eventually support:\n\n- New APIs in node.js that are not available in older versions of node\n- ECMAScript7 Streams\n\n[bluebird]: https://github.com/petkaantonov/bluebird\n\n[npm-image]: https://img.shields.io/npm/v/mz.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/mz\n[github-tag]: http://img.shields.io/github/tag/normalize/mz.svg?style=flat-square\n[github-url]: https://github.com/normalize/mz/tags\n[travis-image]: https://img.shields.io/travis/normalize/mz.svg?style=flat-square\n[travis-url]: https://travis-ci.org/normalize/mz\n[coveralls-image]: https://img.shields.io/coveralls/normalize/mz.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/normalize/mz?branch=master\n[david-image]: http://img.shields.io/david/normalize/mz.svg?style=flat-square\n[david-url]: https://david-dm.org/normalize/mz\n[license-image]: http://img.shields.io/npm/l/mz.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/mz.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/mz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormalize%2Fmz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormalize%2Fmz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormalize%2Fmz/lists"}