114 lines
5.2 KiB
JSON
114 lines
5.2 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "pify@^2.0.0",
|
|
"scope": null,
|
|
"escapedName": "pify",
|
|
"name": "pify",
|
|
"rawSpec": "^2.0.0",
|
|
"spec": ">=2.0.0 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/load-json-file"
|
|
]
|
|
],
|
|
"_from": "pify@>=2.0.0 <3.0.0",
|
|
"_id": "pify@2.3.0",
|
|
"_inCache": true,
|
|
"_location": "/load-json-file/pify",
|
|
"_nodeVersion": "4.2.1",
|
|
"_npmUser": {
|
|
"name": "sindresorhus",
|
|
"email": "sindresorhus@gmail.com"
|
|
},
|
|
"_npmVersion": "2.14.7",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "pify@^2.0.0",
|
|
"scope": null,
|
|
"escapedName": "pify",
|
|
"name": "pify",
|
|
"rawSpec": "^2.0.0",
|
|
"spec": ">=2.0.0 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/load-json-file"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
|
"_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c",
|
|
"_shrinkwrap": null,
|
|
"_spec": "pify@^2.0.0",
|
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/load-json-file",
|
|
"author": {
|
|
"name": "Sindre Sorhus",
|
|
"email": "sindresorhus@gmail.com",
|
|
"url": "sindresorhus.com"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/sindresorhus/pify/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "Promisify a callback-style function",
|
|
"devDependencies": {
|
|
"ava": "*",
|
|
"pinkie-promise": "^1.0.0",
|
|
"v8-natives": "0.0.2",
|
|
"xo": "*"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c",
|
|
"tarball": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
|
|
},
|
|
"engines": {
|
|
"node": ">=0.10.0"
|
|
},
|
|
"files": [
|
|
"index.js"
|
|
],
|
|
"gitHead": "2dd0d8b880e4ebcc5cc33ae126b02647418e4440",
|
|
"homepage": "https://github.com/sindresorhus/pify#readme",
|
|
"keywords": [
|
|
"promise",
|
|
"promises",
|
|
"promisify",
|
|
"denodify",
|
|
"denodeify",
|
|
"callback",
|
|
"cb",
|
|
"node",
|
|
"then",
|
|
"thenify",
|
|
"convert",
|
|
"transform",
|
|
"wrap",
|
|
"wrapper",
|
|
"bind",
|
|
"to",
|
|
"async",
|
|
"es2015"
|
|
],
|
|
"license": "MIT",
|
|
"maintainers": [
|
|
{
|
|
"name": "sindresorhus",
|
|
"email": "sindresorhus@gmail.com"
|
|
}
|
|
],
|
|
"name": "pify",
|
|
"optionalDependencies": {},
|
|
"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",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/sindresorhus/pify.git"
|
|
},
|
|
"scripts": {
|
|
"optimization-test": "node --allow-natives-syntax optimization-test.js",
|
|
"test": "xo && ava && npm run optimization-test"
|
|
},
|
|
"version": "2.3.0"
|
|
}
|