123 lines
4.8 KiB
JSON
123 lines
4.8 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "p-locate@^2.0.0",
|
|
"scope": null,
|
|
"escapedName": "p-locate",
|
|
"name": "p-locate",
|
|
"rawSpec": "^2.0.0",
|
|
"spec": ">=2.0.0 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/locate-path"
|
|
]
|
|
],
|
|
"_from": "p-locate@>=2.0.0 <3.0.0",
|
|
"_id": "p-locate@2.0.0",
|
|
"_inCache": true,
|
|
"_location": "/p-locate",
|
|
"_nodeVersion": "7.2.0",
|
|
"_npmOperationalInternal": {
|
|
"host": "packages-12-west.internal.npmjs.com",
|
|
"tmp": "tmp/p-locate-2.0.0.tgz_1480310721089_0.044998719124123454"
|
|
},
|
|
"_npmUser": {
|
|
"name": "sindresorhus",
|
|
"email": "sindresorhus@gmail.com"
|
|
},
|
|
"_npmVersion": "3.10.9",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "p-locate@^2.0.0",
|
|
"scope": null,
|
|
"escapedName": "p-locate",
|
|
"name": "p-locate",
|
|
"rawSpec": "^2.0.0",
|
|
"spec": ">=2.0.0 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/locate-path"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
|
"_shasum": "20a0103b222a70c8fd39cc2e580680f3dde5ec43",
|
|
"_shrinkwrap": null,
|
|
"_spec": "p-locate@^2.0.0",
|
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/locate-path",
|
|
"author": {
|
|
"name": "Sindre Sorhus",
|
|
"email": "sindresorhus@gmail.com",
|
|
"url": "sindresorhus.com"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/sindresorhus/p-locate/issues"
|
|
},
|
|
"dependencies": {
|
|
"p-limit": "^1.1.0"
|
|
},
|
|
"description": "Get the first fulfilled promise that satisfies the provided testing function",
|
|
"devDependencies": {
|
|
"ava": "*",
|
|
"delay": "^1.3.1",
|
|
"in-range": "^1.0.0",
|
|
"time-span": "^1.0.0",
|
|
"xo": "*"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "20a0103b222a70c8fd39cc2e580680f3dde5ec43",
|
|
"tarball": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz"
|
|
},
|
|
"engines": {
|
|
"node": ">=4"
|
|
},
|
|
"files": [
|
|
"index.js"
|
|
],
|
|
"gitHead": "6300abb6451f04bbaa760f42844ec1c501d79120",
|
|
"homepage": "https://github.com/sindresorhus/p-locate#readme",
|
|
"keywords": [
|
|
"promise",
|
|
"locate",
|
|
"find",
|
|
"finder",
|
|
"search",
|
|
"searcher",
|
|
"test",
|
|
"array",
|
|
"collection",
|
|
"iterable",
|
|
"iterator",
|
|
"race",
|
|
"fulfilled",
|
|
"fastest",
|
|
"async",
|
|
"await",
|
|
"promises",
|
|
"bluebird"
|
|
],
|
|
"license": "MIT",
|
|
"maintainers": [
|
|
{
|
|
"name": "sindresorhus",
|
|
"email": "sindresorhus@gmail.com"
|
|
}
|
|
],
|
|
"name": "p-locate",
|
|
"optionalDependencies": {},
|
|
"readme": "# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate)\n\n> Get the first fulfilled promise that satisfies the provided testing function\n\nThink of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).\n\n\n## Install\n\n```\n$ npm install --save p-locate\n```\n\n\n## Usage\n\nHere we find the first file that exists on disk, in array order.\n\n```js\nconst pathExists = require('path-exists');\nconst pLocate = require('p-locate');\n\nconst files = [\n\t'unicorn.png',\n\t'rainbow.png', // only this one actually exists on disk\n\t'pony.png'\n];\n\npLocate(files, file => pathExists(file)).then(foundPath => {\n\tconsole.log(foundPath);\n\t//=> 'rainbow'\n});\n```\n\n*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*\n\n\n## API\n\n### pLocate(input, tester, [options])\n\nReturns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.\n\n#### input\n\nType: `Iterable<Promise|any>`\n\n#### tester(element)\n\nType: `Function`\n\nExpected to return a `Promise<boolean>` or boolean.\n\n#### options\n\nType: `Object`\n\n##### concurrency\n\nType: `number`<br>\nDefault: `Infinity`<br>\nMinimum: `1`\n\nNumber of concurrently pending promises returned by `tester`.\n\n##### preserveOrder\n\nType: `boolean`<br>\nDefault: `true`\n\nPreserve `input` order when searching.\n\nDisable this to improve performance if you don't care about the order.\n\n\n## Related\n\n- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently\n- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently\n- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
|
|
"readmeFilename": "readme.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/sindresorhus/p-locate.git"
|
|
},
|
|
"scripts": {
|
|
"test": "xo && ava"
|
|
},
|
|
"version": "2.0.0",
|
|
"xo": {
|
|
"esnext": true
|
|
}
|
|
}
|