{
  "name": "pify",
  "version": "2.3.0",
  "description": "Promisify a callback-style function",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/sindresorhus/pify"
  },
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "sindresorhus.com"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "xo && ava && npm run optimization-test",
    "optimization-test": "node --allow-natives-syntax optimization-test.js"
  },
  "files": [
    "index.js"
  ],
  "keywords": [
    "promise",
    "promises",
    "promisify",
    "denodify",
    "denodeify",
    "callback",
    "cb",
    "node",
    "then",
    "thenify",
    "convert",
    "transform",
    "wrap",
    "wrapper",
    "bind",
    "to",
    "async",
    "es2015"
  ],
  "devDependencies": {
    "ava": "*",
    "pinkie-promise": "^1.0.0",
    "v8-natives": "0.0.2",
    "xo": "*"
  },
  "readme": "# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify)\n\n> Promisify a callback-style function\n\n\n## Install\n\n```\n$ npm install --save pify\n```\n\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst pify = require('pify');\n\n// promisify a single function\n\npify(fs.readFile)('package.json', 'utf8').then(data => {\n\tconsole.log(JSON.parse(data).name);\n\t//=> 'pify'\n});\n\n// or promisify all methods in a module\n\npify(fs).readFile('package.json', 'utf8').then(data => {\n\tconsole.log(JSON.parse(data).name);\n\t//=> 'pify'\n});\n```\n\n\n## API\n\n### pify(input, [promiseModule], [options])\n\nReturns a promise wrapped version of the supplied function or module.\n\n#### input\n\nType: `function`, `object`\n\nCallback-style function or module whose methods you want to promisify.\n\n#### promiseModule\n\nType: `function`\n\nCustom promise module to use instead of the native one.\n\nCheck out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.\n\n#### options\n\n##### multiArgs\n\nType: `boolean`  \nDefault: `false`\n\nBy default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument.\n\n```js\nconst request = require('request');\nconst pify = require('pify');\n\npify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {\n\tconst [httpResponse, body] = result;\n});\n```\n\n##### include\n\nType: `array` of (`string`|`regex`)\n\nMethods in a module to promisify. Remaining methods will be left untouched.\n\n##### exclude\n\nType: `array` of (`string`|`regex`)  \nDefault: `[/.+Sync$/]`\n\nMethods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.\n\n##### excludeMain\n\nType: `boolean`  \nDefault: `false`\n\nBy default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module.\n\n```js\nconst pify = require('pify');\n\nfunction fn() {\n\treturn true;\n}\n\nfn.method = (data, callback) => {\n\tsetImmediate(() => {\n\t\tcallback(data, null);\n\t});\n};\n\n// promisify methods but not fn()\nconst promiseFn = pify(fn, {excludeMain: true});\n\nif (promiseFn()) {\n\tpromiseFn.method('hi').then(data => {\n\t\tconsole.log(data);\n\t});\n}\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
  "readmeFilename": "readme.md",
  "bugs": {
    "url": "https://github.com/sindresorhus/pify/issues"
  },
  "homepage": "https://github.com/sindresorhus/pify",
  "_id": "pify@2.3.0",
  "dist": {
    "shasum": "750aaec1a74948df47ae0904da838d060a2ea1e9"
  },
  "_from": "pify@^2.0.0",
  "_resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
}
