{"_id":"nodeify","_rev":"10-f12c3cf8fc99abfc798a01abbebeddc1","name":"nodeify","description":"Convert promised code to use node style callbacks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"nodeify","version":"1.0.0","description":"Convert promised code to use node style callbacks","scripts":{"test":"mocha -R spec","prepublish":"npm test"},"repository":{"type":"git","url":"https://github.com/then/nodeify.git"},"keywords":["promise","then","nodeify","callback"],"author":{"name":"ForbesLindesay"},"license":"MIT","devDependencies":{"mocha":"~1.8.1","mocha-as-promised":"~1.2.1","sinon":"~1.6.0"},"dependencies":{"promise":"~1.3.0","is-promise":"~1.0.0"},"_id":"nodeify@1.0.0","dist":{"shasum":"2a106c7bfbd6b8490dd53c130ddbfe2ae639a856","tarball":"https://registry.npmjs.org/nodeify/-/nodeify-1.0.0.tgz","integrity":"sha512-bPTdo/j/ne6lHs+jTOj5e42H+PtbUvRXxdpFYB6rex8zckAfsj1uUGb2383JUPOwX1aW7IIB1ftBZ4TLxJ1yBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByp6qSbe/KvZHqfMQQfrJGM3V2dI/CWYwJA1FnShY2EAiEA+2zu7Qr2N0dx20Iv+wvdDdQPXc9RZTw6gK6EhehGrbU="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}]},"1.0.1":{"name":"nodeify","version":"1.0.1","description":"Convert promised code to use node style callbacks","scripts":{"test":"mocha -R spec","prepublish":"npm test"},"repository":{"type":"git","url":"git+https://github.com/then/nodeify.git"},"keywords":["promise","then","nodeify","callback"],"author":{"name":"ForbesLindesay"},"license":"MIT","devDependencies":{"mocha":"~1.8.1","mocha-as-promised":"~1.2.1"},"dependencies":{"promise":"~1.3.0","is-promise":"~1.0.0"},"gitHead":"444f8a68890fd08b9b30113784833283c61d277e","bugs":{"url":"https://github.com/then/nodeify/issues"},"homepage":"https://github.com/then/nodeify#readme","_id":"nodeify@1.0.1","_shasum":"64ab69a7bdbaf03ce107b4f0335c87c0b9e91b1d","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"dist":{"shasum":"64ab69a7bdbaf03ce107b4f0335c87c0b9e91b1d","tarball":"https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz","integrity":"sha512-n7C2NyEze8GCo/z73KdbjRsBiLbv6eBn1FxwYKQ23IqGo7pQY3mhQan61Sv7eEDJCiyUjTVrVkXTzJCo1dW7Aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6EpxqnJO7YS7ljuSbPXo8ExFg1PwQuiyssukpb3UJJQIgKJWKkEHJmujBn/fgdT3SqoG3FduhJBYlMDMbOJ8CjSo="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/nodeify-1.0.1.tgz_1488126259719_0.5255854076240212"}}},"readme":"[![Build Status](https://img.shields.io/travis/then/nodeify/master.svg)](https://travis-ci.org/then/nodeify)\n# Nodeify\n\n  Convert promised code to use node style callbacks.  If no callback is provided it will just return the original promise.\n\n## Installation\n\n  Server:\n\n    $ npm install nodeify\n\n## Usage\n\n### Functional\n\n  Call `nodeify` directly passing the `promise` and an optional `callback` as arguments.  If a `callback` is provided it will be called as `callback(error, result)`.  If `callback` is not a function, `promise` is returned.\n\n```javascript\nvar nodeify = require('nodeify');\n\nfunction myAsyncMethod(arg, callback) {\n  return nodeify(myPromiseMethod(arg), callback);\n}\n```\n\n### Constructor / Method\n\n  The `nodeify.Promise` constructor returns a promise with a `.nodeify` method which behaves just like the functional version above except that the first argument is implicitly `this`.\n\n```javascript\nvar Promise = require('nodeify').Promise;\n\nfunction myAsyncMethod(arg, callback) {\n  return new Promise(function (resolver) {\n    //do async work\n  })\n  .nodeify(callback);\n}\n```\n\n### Extend\n\n#### Extend(promise)\n\n  Takes a promise and extends it to support the `.nodeify` method.  It will still support the nodeify method after calls to `.then`.\n\n```javascript\nvar Promise = require('promise');\nvar nodeify = require('nodeify');\n\nfunction myAsyncMethod(arg, callback) {\n  return nodeify.extend(myPromiseMethod(arg))\n    .nodeify(callback);\n}\n```\n\n#### Extend(PromiseConstructor)\n\n  Takes a PromiseConstructor and extends it to support the `.nodeify` method.\n\n```javascript\nvar PromiseConstructor = require('promise-constructor-used-by-my-promise-method');\n\nrequire('nodeify').extend(PromiseConstructor);\n\nfunction myAsyncMethod(arg, callback) {\n  return myPromiseMethod(arg).nodeify(callback);\n}\n```\n\n#### Extend()\n\n  Extends the default promise constructor (returned by calling `require('promise')`) and extends it to support `.nodeify`.\n\n```javascript\nrequire('nodeify').extend();\n\nfunction myAsyncMethod(arg, callback) {\n  //assuming myPromiseMethod uses `promise` as its promise library\n  return myPromiseMethod(arg).nodeify(callback);\n}\n```\n\n## Licence\n\n  MIT\n\n![viewcount](https://viewcount.jepso.com/count/then/nodeify.png)\n","maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"time":{"modified":"2022-06-22T02:13:43.322Z","created":"2013-02-28T17:44:22.441Z","1.0.0":"2013-02-28T17:44:25.596Z","1.0.1":"2017-02-26T16:24:21.770Z"},"author":{"name":"ForbesLindesay"},"repository":{"type":"git","url":"git+https://github.com/then/nodeify.git"},"users":{"leedm777":true,"ruffrey":true,"garthk":true,"rsp":true},"homepage":"https://github.com/then/nodeify#readme","keywords":["promise","then","nodeify","callback"],"bugs":{"url":"https://github.com/then/nodeify/issues"},"license":"MIT","readmeFilename":"README.md"}