{"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dead-horse","email":"dead_horse@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"}],"keywords":["promisify","promise","thenify","then","es6"],"dist-tags":{"latest":"3.2.1"},"author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"description":"Promisify a callback-based function","readme":"\n# thenify\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\nPromisify a callback-based function using [`any-promise`](https://github.com/kevinbeaty/any-promise).\n\n- Preserves function names\n- Uses a native promise implementation if available and tries to fall back to a promise implementation such as `bluebird`\n- Converts multiple arguments from the callback into an `Array`\n- Resulting function never deoptimizes\n- Supports both callback and promise style\n\nAn added benefit is that `throw`n errors in that async function will be caught by the promise!\n\n## API\n\n- Turn async functions into promises\n\n```js\nvar thenify = require('thenify');\n\nvar somethingAsync = thenify(function somethingAsync(a, b, c, callback) {\n  callback(null, a, b, c);\n});\n```\n\n- Backward compatible with callback\n\n```js\nvar thenify = require('thenify').withCallback;\n\nvar somethingAsync = thenify(function somethingAsync(a, b, c, callback) {\n  callback(null, a, b, c);\n});\n\n// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected);\n// somethingAsync(a, b, c, function () {});\n```\n\n### var fn = thenify(fn)\n\nPromisifies a function.\n\n[gitter-image]: https://badges.gitter.im/thenables/thenify.png\n[gitter-url]: https://gitter.im/thenables/thenify\n[npm-image]: https://img.shields.io/npm/v/thenify.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/thenify\n[github-tag]: http://img.shields.io/github/tag/thenables/thenify.svg?style=flat-square\n[github-url]: https://github.com/thenables/thenify/tags\n[travis-image]: https://img.shields.io/travis/thenables/thenify.svg?style=flat-square\n[travis-url]: https://travis-ci.org/thenables/thenify\n[coveralls-image]: https://img.shields.io/coveralls/thenables/thenify.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/thenables/thenify\n[david-image]: http://img.shields.io/david/thenables/thenify.svg?style=flat-square\n[david-url]: https://david-dm.org/thenables/thenify\n[license-image]: http://img.shields.io/npm/l/thenify.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/thenify.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/thenify\n","repository":{"type":"git","url":"git+https://github.com/thenables/thenify.git"},"users":{"shumkov":true,"icflorescu":true,"brooksn":true,"moimikey":true,"sylchamber":true,"tobiasnickel":true,"nickeltobias":true,"david-ruzicka":true,"stevenvachon":true,"cljames":true},"bugs":{"url":"https://github.com/thenables/thenify/issues"},"license":"MIT","versions":{"1.0.0":{"name":"thenify","description":"Globally make everything a promise!","version":"1.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/thenify"},"dependencies":{},"devDependencies":{"mocha":"1","istanbul":"0"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["then","array","promise","promises","await"],"files":["index.js"],"gitHead":"5d5303a6c866da59693ab41996e7f4fff66e50d0","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify","_id":"thenify@1.0.0","_shasum":"bdd58503e7e2590f9c4cf237eec1d5cdcae050ed","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"bdd58503e7e2590f9c4cf237eec1d5cdcae050ed","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-1.0.0.tgz"},"directories":{}},"2.0.0":{"name":"thenify","description":"Promisify a callback-based function","version":"2.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/thenify"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"2"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"db03bb73f7b5e22bc6e1b268d89a50781f1bea0d","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify","_id":"thenify@2.0.0","_shasum":"a1c6a07b4274787c412289d4f8679b545205f186","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"a1c6a07b4274787c412289d4f8679b545205f186","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-2.0.0.tgz"},"directories":{}},"3.0.0":{"name":"thenify","description":"Promisify a callback-based function","version":"3.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/thenify"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"2"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"27fa50bad00b65a1e664ca085c65acd8c5988572","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify","_id":"thenify@3.0.0","_shasum":"7de788acfb33bcc0dae8280c98cda7e17e9cf9ee","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"7de788acfb33bcc0dae8280c98cda7e17e9cf9ee","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-3.0.0.tgz"},"directories":{}},"3.1.0":{"name":"thenify","description":"Promisify a callback-based function","version":"3.1.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/thenables/thenify"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"2"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"4c093c3583662f20f3342d59f73d61bb96f7d826","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify","_id":"thenify@3.1.0","_shasum":"c27cbbc62b7c287edf1a1a3d5cc8426d8aed49f0","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.11.14","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dead-horse","email":"dead_horse@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"}],"dist":{"shasum":"c27cbbc62b7c287edf1a1a3d5cc8426d8aed49f0","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-3.1.0.tgz"},"directories":{}},"3.1.1":{"name":"thenify","description":"Promisify a callback-based function","version":"3.1.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/thenables/thenify.git"},"dependencies":{"native-or-bluebird":"1"},"devDependencies":{"bluebird":"2","istanbul":"0","mocha":"2"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"3c2af64fd708a33b969c05757bee8a12038eb211","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify#readme","_id":"thenify@3.1.1","_shasum":"f25114ce444dfa52fe5b39170baf5d3a05a63f06","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"f25114ce444dfa52fe5b39170baf5d3a05a63f06","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-3.1.1.tgz"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dead-horse","email":"dead_horse@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{}},"3.2.0":{"name":"thenify","description":"Promisify a callback-based function","version":"3.2.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/thenables/thenify.git"},"dependencies":{"any-promise":"^1.0.0"},"devDependencies":{"bluebird":"^3.1.1","istanbul":"^0.4.0","mocha":"^2.0.0"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"89bdcb82809dfa46a157b25c5d2bac36ed429b9b","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify#readme","_id":"thenify@3.2.0","_shasum":"40b902b1bc4416dc08d86f10ffff3586f0ec71b9","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"40b902b1bc4416dc08d86f10ffff3586f0ec71b9","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-3.2.0.tgz"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dead-horse","email":"dead_horse@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"}],"_npmOperationalInternal":{"host":"packages-8-eu.internal.npmjs.com","tmp":"tmp/thenify-3.2.0.tgz_1454358563746_0.7461334459949285"},"directories":{}},"3.2.1":{"name":"thenify","description":"Promisify a callback-based function","version":"3.2.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/thenables/thenify.git"},"dependencies":{"any-promise":"^1.0.0"},"devDependencies":{"bluebird":"^3.1.1","istanbul":"^0.4.0","mocha":"^3.0.2"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["promisify","promise","thenify","then","es6"],"files":["index.js"],"gitHead":"42e93a084347eed9ad34cd3f77728e7fe9b2c1c5","bugs":{"url":"https://github.com/thenables/thenify/issues"},"homepage":"https://github.com/thenables/thenify#readme","_id":"thenify@3.2.1","_shasum":"251fd1c80aff6e5cf57cb179ab1fcb724269bd11","_from":".","_npmVersion":"3.10.3","_nodeVersion":"4.4.7","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dead-horse","email":"dead_horse@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"}],"dist":{"shasum":"251fd1c80aff6e5cf57cb179ab1fcb724269bd11","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/thenify/-/thenify-3.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/thenify-3.2.1.tgz_1476096494606_0.22121428861282766"},"directories":{}}},"name":"thenify","time":{"modified":"2016-12-02T23:42:45.423Z","created":"2014-08-09T23:34:21.073Z","1.0.0":"2014-08-09T23:34:21.073Z","2.0.0":"2014-12-17T06:23:24.197Z","3.0.0":"2014-12-25T08:18:14.350Z","3.1.0":"2015-01-06T03:32:20.600Z","3.1.1":"2015-10-20T18:22:01.954Z","3.2.0":"2016-02-01T20:29:26.986Z","3.2.1":"2016-10-10T10:48:16.435Z"},"readmeFilename":"README.md","homepage":"https://github.com/thenables/thenify#readme"}