{"_id":"promisify-es6","_rev":"4573368","name":"promisify-es6","description":"Promisify callback-style functions to ES6 promises","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"xeryan","email":""}],"time":{"modified":"2026-04-10T15:34:38.000Z","created":"2016-04-02T10:27:57.548Z","1.0.3":"2017-07-26T08:46:23.552Z","1.0.2":"2016-09-14T14:01:35.633Z","1.0.1":"2016-04-02T10:27:57.548Z"},"users":{},"author":{"name":"Manuel Di Iorio"},"repository":{"type":"git","url":"git+https://github.com/manuel-di-iorio/promisify-es6.git"},"versions":{"1.0.3":{"author":{"name":"Manuel Di Iorio"},"bugs":{"url":"https://github.com/manuel-di-iorio/promisify-es6/issues"},"bundleDependencies":[],"deprecated":"Unmaintained","description":"Promisify callback-style functions to ES6 promises","devDependencies":{"mocha":"^2.4.5"},"homepage":"https://github.com/manuel-di-iorio/promisify-es6#readme","keywords":["promise","promisify","es6","function","callback"],"license":"MIT","main":"index.js","name":"promisify-es6","repository":{"type":"git","url":"git+https://github.com/manuel-di-iorio/promisify-es6.git"},"scripts":{"test":"mocha test"},"version":"1.0.3","gitHead":"3fb20250c335aebf22775e6b0fbb42e3f6eb662c","_id":"promisify-es6@1.0.3","_npmVersion":"5.0.3","_nodeVersion":"8.1.4","_npmUser":{"name":"xeryan","email":"xeryan@gmail.com"},"dist":{"shasum":"b012668c4df3c965ce13daac2b3a4d1726a96346","size":3550,"noattachment":false,"key":"/promisify-es6/-/promisify-es6-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/promisify-es6/download/promisify-es6-1.0.3.tgz"},"maintainers":[{"name":"xeryan","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promisify-es6-1.0.3.tgz_1501058781503_0.5212752232328057"},"directories":{},"publish_time":1501058783552,"_hasShrinkwrap":false,"_cnpm_publish_time":1501058783552,"_cnpmcore_publish_time":"2021-12-16T18:33:59.212Z"},"1.0.2":{"name":"promisify-es6","version":"1.0.2","description":"Promisify callback-style functions to ES6 promises","main":"index.js","scripts":{"test":"mocha test"},"repository":{"type":"git","url":"git+https://github.com/manuel-di-iorio/promisify-es6.git"},"keywords":["promise","promisify","es6","function","callback"],"author":{"name":"Manuel Di Iorio"},"license":"MIT","bugs":{"url":"https://github.com/manuel-di-iorio/promisify-es6/issues"},"homepage":"https://github.com/manuel-di-iorio/promisify-es6#readme","devDependencies":{"mocha":"^2.4.5"},"gitHead":"8b1e5be29086426ab1e9141f781f29d5fc268a0c","_id":"promisify-es6@1.0.2","_shasum":"63093553e39be5036d757b455fb93d155da4b589","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.0","_npmUser":{"name":"xeryan","email":"xeryan@gmail.com"},"dist":{"shasum":"63093553e39be5036d757b455fb93d155da4b589","size":3065,"noattachment":false,"key":"/promisify-es6/-/promisify-es6-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/promisify-es6/download/promisify-es6-1.0.2.tgz"},"maintainers":[{"name":"xeryan","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promisify-es6-1.0.2.tgz_1473861694007_0.26837779162451625"},"directories":{},"publish_time":1473861695633,"_hasShrinkwrap":false,"_cnpm_publish_time":1473861695633,"_cnpmcore_publish_time":"2021-12-16T18:33:59.405Z"},"1.0.1":{"name":"promisify-es6","version":"1.0.1","description":"Promisify callback-style functions to ES6 promises","main":"index.js","scripts":{"test":"mocha test"},"repository":{"type":"git","url":"git+https://github.com/manuel-di-iorio/promisify-es6.git"},"keywords":["promise","promisify","es6","function","callback"],"author":{"name":"Manuel Di Iorio"},"license":"MIT","bugs":{"url":"https://github.com/manuel-di-iorio/promisify-es6/issues"},"homepage":"https://github.com/manuel-di-iorio/promisify-es6#readme","devDependencies":{"mocha":"^2.4.5"},"gitHead":"f37dad951f9c9f07f00b382fe6af96238b6d1bb9","_id":"promisify-es6@1.0.1","_shasum":"ef30c09481a9ad1539ae5088261ae8363d981c84","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.4.0","_npmUser":{"name":"xeryan","email":"xeryan@gmail.com"},"dist":{"shasum":"ef30c09481a9ad1539ae5088261ae8363d981c84","size":2856,"noattachment":false,"key":"/promisify-es6/-/promisify-es6-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promisify-es6/download/promisify-es6-1.0.1.tgz"},"maintainers":[{"name":"xeryan","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promisify-es6-1.0.1.tgz_1459592875166_0.7985048433765769"},"directories":{},"publish_time":1459592877548,"_hasShrinkwrap":false,"_cnpm_publish_time":1459592877548,"_cnpmcore_publish_time":"2021-12-16T18:33:59.612Z"}},"readme":"**NOTE:** Starting from Node.js v.8.0.0, the promisify method is now included in the `util` native library.\r\n\r\nOn Node.js, the usage of the native method is recommended!\r\n\r\n```\r\n// Native promisify example\r\nconst util = require('util');\r\nconst readfile = util.promisify(fs.readFile);\r\n```\r\n\r\n# ES6 Promisify\r\n## This is a library to promisify callback-style functions to ES6 promises. You can also use it on the client-side.\r\n\r\n### Install it with:\r\n\r\n    npm i --save promisify-es6\r\n    or\r\n    git clone https://github.com/manuel-di-iorio/promisify-es6.git\r\n\r\n### Example:\r\n\r\n```javascript\r\nvar promisify = require(\"promisify-es6\");\r\nvar fs = require(\"fs\");\r\nvar readFile = promisify(fs.readFile);\r\n\r\nreadFile(\"test.js\")\r\n .then(function(content) {\r\n    console.log(content.toString());\r\n })\r\n .catch(function(err) {\r\n    console.error(err);\r\n });\r\n```\r\n\r\nA promisified function is still callable with the callback style:\r\n\r\n```javascript\r\nreadFile(\"test.js\", function(err, content) { //etc...\r\n```\r\n\r\nYou can even promisify entire modules or arrays:\r\n\r\n```javascript\r\nvar readFile = promisify(require(\"fs\")).readFile;\r\n```\r\n\r\n## API\r\n\r\n```javascript\r\npromisify(method[, options])\r\n```\r\n    *Method* can be a function or an array/map of functions to promisify\r\n\r\n    *Options* can have the following properties:\r\n\r\n        `context`: The context which to apply the called function (by default is the function itself)\r\n        `replace`: When an array/map is passed and this is truthy, it will replace the original object\r\n\r\n### Test with Mocha:\r\n\r\n    npm test\r\n","_attachments":{},"homepage":"https://github.com/manuel-di-iorio/promisify-es6#readme","bugs":{"url":"https://github.com/manuel-di-iorio/promisify-es6/issues"},"license":"MIT"}