{"_id":"promisify-node","_rev":"40-df5a25e8b6bcc85cc8716b05e42b8abe","name":"promisify-node","time":{"modified":"2022-06-24T19:44:50.883Z","created":"2014-04-12T00:32:25.804Z","0.1.0":"2014-04-12T00:32:25.804Z","0.1.1":"2014-04-12T05:03:37.302Z","0.1.2":"2014-04-13T22:17:49.362Z","0.1.3":"2014-11-26T20:37:15.678Z","0.1.4":"2014-11-26T20:49:34.036Z","0.1.5":"2014-11-26T21:45:26.379Z","0.2.0":"2015-08-20T16:32:03.101Z","0.2.1":"2015-08-20T17:29:48.233Z","0.3.0":"2015-11-18T18:52:13.998Z","0.4.0":"2016-03-11T07:21:23.263Z","0.5.0":"2018-06-05T16:46:46.836Z"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"},{"name":"tbranyen","email":"tim@tabdeveloper.com"}],"dist-tags":{"latest":"0.5.0"},"description":"Wrap Node-callback functions to return Promises.","readme":"Promisify Node\n--------------\n\n**Stable: 0.5.0** \n\n[![Build\nStatus](https://travis-ci.org/nodegit/promisify-node.png?branch=master)](https://travis-ci.org/nodegit/promisify-node)\n\nMaintained by Tim Branyen [@tbranyen](http://twitter.com/tbranyen).\n\nWraps Node modules, functions, and methods written in the Node-callback style\nto return Promises.\n\n### Install ###\n\n``` bash\nnpm install promisify-node\n```\n\n### Examples ###\n\nWrap entire Node modules recursively:\n\n``` javascript\nvar promisify = require(\"promisify-node\");\nvar fs = promisify(\"fs\");\n\n// This function has been identified as an asynchronous function so it has\n// been automatically wrapped.\nfs.readFile(\"/etc/passwd\").then(function(contents) {\n  console.log(contents);\n});\n```\n\nWrap a single function:\n\n``` javascript\nvar promisify = require(\"promisify-node\");\n\nfunction async(callback) {\n  callback(null, true);\n}\n\n// Convert the function to return a Promise.\nvar wrap = promisify(async);\n\n// Invoke the newly wrapped function.\nwrap().then(function(value) {\n  console.log(value === true);\n});\n```\n\nWrap a method on an Object:\n\n``` javascript\nvar promisify = require(\"promisify-node\");\n\nvar myObj = {\n  myMethod: function(a, b, cb) {\n    cb(a, b);\n  }\n};\n\n// No need to return anything as the methods will be replaced on the object.\npromisify(myObj);\n\n// Intentionally cause a failure by passing an object and inspect the message.\nmyObj.myMethod({ msg: \"Failure!\" }, null).then(null, function(err) {\n  console.log(err.msg);\n});\n```\n\nWrap without mutating the original:\n```javascript\nvar promisify = require(\"promisify-node\");\n\nvar myObj = {\n  myMethod: function(a, b, cb) {\n    cb(a, b);\n  }\n};\n\n// Store the original method to check later\nvar originalMethod = myObj.myMethod;\n\n// Now store the result, since the 'true' value means it won't mutate 'myObj'.\nvar promisifiedObj = promisify(myObj, undefined, true);\n\n// Intentionally cause a failure by passing an object and inspect the message.\npromisifiedObj.myMethod({ msg: \"Failure!\" }, null).then(null, function(err) {\n  console.log(err.msg);\n});\n\n// The original method is still intact\nassert(myObj.myMethod === originalMethod);\nassert(promisifiedObj.myMethod !== myObj.myMethod);\n```\n\n### Tests ###\n\nRun the tests after installing dependencies with:\n\n``` bash\nnpm test\n```\n","versions":{"0.1.1":{"name":"promisify-node","version":"0.1.1","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"promise":"~4.0.0"},"devDependencies":{"mocha":"~1.18.2"},"scripts":{"test":"mocha test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","_id":"promisify-node@0.1.1","dist":{"shasum":"6b586d3af3f88b6914496e8081d1da2d0ccc6c56","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.1.1.tgz","integrity":"sha512-VDX1dcNildLC1vU3vietM+oEk68JiiaeCNGfV7jguU0zYxTao1yAzwOBgrY7PG7cdrXnXAeCkxaMnjm/HOsVUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKveuvjpr+QETPbz9xPL9LOBYLuOPs1A4cqXZrGeJ1lAIhAKyroHOmdFINuH/VXUgiN93+za+s5x9EUmCc9WDl666i"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"}],"directories":{}},"0.1.2":{"name":"promisify-node","version":"0.1.2","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"promise":"~4.0.0"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","_id":"promisify-node@0.1.2","dist":{"shasum":"2d0dc96475413cd5d4a6116839d057e16a27f623","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.1.2.tgz","integrity":"sha512-ygNz0Qx5PcClXCHT4PlnHVgZrxAi9Pf7lBCKlzo6OHVXVfhpCD/WUe/JTlpjsqwISTyNFjonZpuFJUP1N3zlew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHGlp1BxZuN26l4TDqKGX7+04iMg/HLEF17lkCgBIpuQIhAMwBj9IvmQhkFVAGmQtI6DCCU83+pH3ALDUxuTKugqvP"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"}],"directories":{}},"0.1.3":{"name":"promisify-node","version":"0.1.3","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~1.0.0"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"cb10362a498550b376faad751fbccc2d44f38346","_id":"promisify-node@0.1.3","_shasum":"676542f468a872a71e4879190840f34536523d54","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"676542f468a872a71e4879190840f34536523d54","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.1.3.tgz","integrity":"sha512-kapD1KplLitGLw/bXTtO50KsPV+3iDSKOij+hb/WnbJjzH1uyqBNsY/2AgzwEfY7y+vjUHFZY3h1S+/ltEMY8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEN5a0flqiIRZOIe7tnDG1q6IGZacoyBdR7JCdGDpwY/AiEA/5KS0ggRUOSVjo3VH9/DsEwAKHPUhSIhT9bYqnI11Q8="}]},"directories":{}},"0.1.4":{"name":"promisify-node","version":"0.1.4","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~1.0.0"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"42dc06b834fb4a32ede7f03dded4f6352fc7abe2","_id":"promisify-node@0.1.4","_shasum":"463bbb9b6c9cf606ab6eb800fe54e6f90a837d41","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"463bbb9b6c9cf606ab6eb800fe54e6f90a837d41","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.1.4.tgz","integrity":"sha512-/eAWv3iH2eGwAbxphzGMAWrSlDWRmjeIKpOlfTTDzn3PG3Rq7QvhyFsjHX+GQaUx5QshKLoIV3G6/rwqpX4UMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwZuEJ5vBDgyZd33CVpOMF0pqiUhFfwViOwR+Kc6aE8AiBKHH/t1g8oyR5dGPyBQtNzF8vk3g+Ix05hYDrBqjKO9g=="}]},"directories":{}},"0.1.5":{"name":"promisify-node","version":"0.1.5","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~1.0.0"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"fc0b254430f3e580dadf190de1ba220d766236b2","_id":"promisify-node@0.1.5","_shasum":"8cd6afad43fa0684289e2db83bc223363cd61a4d","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"8cd6afad43fa0684289e2db83bc223363cd61a4d","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.1.5.tgz","integrity":"sha512-7v+Ir+TsTg8ejpqLmWJhoOP+YzlaMLJOc29J48f01XeGgXIud0WxmyKMgoxRkIoCl6pSB0uan7g2eSxBrTVN2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7euYeQ8AwtbbGm/VYT6bm/pBK7PHKTrPvvsndC8M1hAiB9i65QQ0PYZLQaLrZMkLc+AUuqR2U06X8hxwVBcrV+Tg=="}]},"directories":{}},"0.2.0":{"name":"promisify-node","version":"0.2.0","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~3.0.2"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"repository":{"type":"git","url":"https://github.com/nodegit/promisify-node.git"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"7be4dad2acf9fff26d0506f476c52a15fec18e21","bugs":{"url":"https://github.com/nodegit/promisify-node/issues"},"homepage":"https://github.com/nodegit/promisify-node","_id":"promisify-node@0.2.0","_shasum":"e412a0507562f569d90627465464b4f3d7dfc319","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"johnhaley81","email":"john@haley.io"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"e412a0507562f569d90627465464b4f3d7dfc319","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.2.0.tgz","integrity":"sha512-izLim+5xozf7Dy6e6AdoFUQBqbDRnDqZ+WucqHDhUBPowkCLm0ok9MyVHo8kNujGRGhmyOUABx0JwTG7GZqHjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDFlIkCs/1WlFuzG+qgVugCenDmtUAwaH0aVGKPIZGkAiEAw87J34CSqSGvq61mxsUonjWOpEUiHNeJBLQQdVXzfVE="}]},"directories":{}},"0.2.1":{"name":"promisify-node","version":"0.2.1","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~3.0.2"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"repository":{"type":"git","url":"https://github.com/nodegit/promisify-node.git"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"7a675afe42e6ab656e9d1bf20db1f014e2d8ac98","bugs":{"url":"https://github.com/nodegit/promisify-node/issues"},"homepage":"https://github.com/nodegit/promisify-node","_id":"promisify-node@0.2.1","_shasum":"88067c37a5015d20941b9a10949a3da6c15f47a6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"johnhaley81","email":"john@haley.io"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"88067c37a5015d20941b9a10949a3da6c15f47a6","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.2.1.tgz","integrity":"sha512-eKqupYBxdDPbn9vyCng7KCw9a4VtUMIKG799k4ufS1F2Pn9PzzGVsuzRLO51FtbXN8wH2SWHq+gK27RRRr+xqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzgN2E+mixFOOkhUbJFylm3fHfQsM/8noJIGTBTLtpxgIhANWR5f8zI94xUK9vJabU3WL3cdyOBszFkzGo6m6YNZBp"}]},"directories":{}},"0.3.0":{"name":"promisify-node","version":"0.3.0","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~4.0.0"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"repository":{"type":"git","url":"git+https://github.com/nodegit/promisify-node.git"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"193b0c4b954b3701d714b458f0e9142b4401dce3","bugs":{"url":"https://github.com/nodegit/promisify-node/issues"},"homepage":"https://github.com/nodegit/promisify-node#readme","_id":"promisify-node@0.3.0","_shasum":"b4b55acf90faa7d2b8b90ca396899086c03060cf","_from":".","_npmVersion":"2.14.8","_nodeVersion":"0.12.7","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"b4b55acf90faa7d2b8b90ca396899086c03060cf","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.3.0.tgz","integrity":"sha512-+EQBz005ZGiKzKaaFNmirdmAD4KVkW6TmJKhjQXNvX+SRVeFhMXZwDqxJqb2rDS3RG5hwIJbfZPI7j5czveDaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOFjE+tNe+TZv1UESF2jGrGLgyPrZX0mlr5x0fhFpcMAiEA2f8fzVR5caUTVLMRz248h6IRyg3UQbrmn7zh0IQPveY="}]},"directories":{}},"0.4.0":{"name":"promisify-node","version":"0.4.0","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"~4.0.0","object-assign":"^4.0.1"},"devDependencies":{"mocha":"~1.18.2","istanbul":"~0.2.7"},"repository":{"type":"git","url":"git+https://github.com/nodegit/promisify-node.git"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"81db7d07409865b1ce08bd637b0e0c0b71fb8b65","bugs":{"url":"https://github.com/nodegit/promisify-node/issues"},"homepage":"https://github.com/nodegit/promisify-node#readme","_id":"promisify-node@0.4.0","_shasum":"32803874ec411784e4786c339902a87a179a469c","_from":".","_npmVersion":"2.14.9","_nodeVersion":"5.0.0","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"dist":{"shasum":"32803874ec411784e4786c339902a87a179a469c","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.4.0.tgz","integrity":"sha512-hR/8ZP2mx8RgfMT+jpY+YD3wGvinSReEtq2p2tDvCsUOPDzcWbUhZwf5+Md0ilQlDWsSEYIK9gSv7EPTKRom7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYubB253R+XGnOLF4ONd+rWx6pMiZSFhlsI4BXoG31agIhAKboQXPjyTFEaEolI/LowsWRCYmW6KLHL70CBGS+Jp0R"}]},"maintainers":[{"name":"tbranyen","email":"tim@tabdeveloper.com"},{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promisify-node-0.4.0.tgz_1457680882833_0.602071154396981"},"directories":{}},"0.5.0":{"name":"promisify-node","version":"0.5.0","description":"Wrap Node-callback functions to return Promises.","main":"index.js","dependencies":{"nodegit-promise":"^4.0.0","object-assign":"^4.1.1"},"devDependencies":{"mocha":"^5.2.0","istanbul":"^0.4.5"},"repository":{"type":"git","url":"git+https://github.com/nodegit/promisify-node.git"},"scripts":{"test":"istanbul cover _mocha -- test"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","gitHead":"02fc47cfc00146a533193bc4740e2e3e3be81c6f","bugs":{"url":"https://github.com/nodegit/promisify-node/issues"},"homepage":"https://github.com/nodegit/promisify-node#readme","_id":"promisify-node@0.5.0","_npmVersion":"5.3.0","_nodeVersion":"10.3.0","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"dist":{"integrity":"sha512-GR2E4qgCoKFTprhULqP2OP3bl8kHo16XtnqtkHH6be7tPW1yL6rXd15nl3oV2sLTFv1+j6tqoF69VVpFtJ/j+A==","shasum":"b7115a9d5cd241e939c96e260acda24938d25720","tarball":"https://registry.npmjs.org/promisify-node/-/promisify-node-0.5.0.tgz","fileCount":11,"unpackedSize":18103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFr53CRA9TVsSAnZWagAAmu0P/jfGwq1WrEEMxdka5/xr\nfB3HBWn5IFlm7gd9tuPMbN0bSvui6Kg9GDbz8rkDxjB2rKbC/dtwEMGZ0kyP\n7Fnup/CHGVD8BMa6iNpfL7dr3TJ8jAB+KlilACoDWG0r2S0WyeZXJg1TJtDH\nnZESy0jOmaa7Cp/ASHQPWbLe7tI0GNeQdu31aOcniv5pkNw76YhJ5z/00n0Y\ncptM9RQKtfw0QN3HdMobatmbdrGSEnw9QXtZDnVZsV7D+7b6n4PocoKb8/8a\n0flywo8nM6hVRg7cEZIbSHWzX0rY4i+AALqXxRu8dWmDkFi5bkIhLUm58TkH\n/IRvPbi+mxWNzjnDz6B9R6NdGP36AWxmMGByNdt7Q70IzLCmgXLOVW7J9+P/\nNmZAKJvleww5pbcjD+ikqLSsQ/tbp0NARLhxpndi1ktoG/9FjlxwbjeY3mXh\nmsZhyWoC8XXHPy7Olo4x4Y8eDPYJYXRDy3LZ9rNWwYdiH+ZBKIeXGkMd91C3\na80DXVrg2yu0A2uQIHsNcvmyVpKcJnfGnw9ADDvoDBQLobbmFy1sOSwh/RFK\n+8i5L8y3v42Xs0aN18lOm40qyRVGtmf/x7VdrlySFK7vf26tNaRgfPiSM1Fh\ngsGTtqCUZ1om0XY8BcfT9SwaBUDxLw88k0sorWefB+0ivvhC+hZ8F63Sas2m\n7zal\r\n=zhdB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/J1otKBVOU0bTKOgH61oACuKwnxPMcfVTdTdo1G4IKgIhANRCV5M9Wa2afV3j/9VgBIYZPByBPUO5zcuDrIauKQRO"}]},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"},{"name":"tbranyen","email":"tim@tabdeveloper.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promisify-node_0.5.0_1528217206437_0.8025078319797676"},"_hasShrinkwrap":false}},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","readmeFilename":"README.md","users":{"mygoare":true,"iolo":true,"mitsugm":true,"henrytseng":true,"newworldcode":true,"iori20091101":true,"haemin":true,"chhetrisushil":true,"kodekracker":true,"lezuse":true,"larrychen":true,"xrush":true,"zhangaz1":true,"voltra":true},"homepage":"https://github.com/nodegit/promisify-node#readme","repository":{"type":"git","url":"git+https://github.com/nodegit/promisify-node.git"},"bugs":{"url":"https://github.com/nodegit/promisify-node/issues"}}