UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

113 lines (112 loc) 4.58 kB
{ "_args": [ [ { "raw": "p-every@^1.0.2", "scope": null, "escapedName": "p-every", "name": "p-every", "rawSpec": "^1.0.2", "spec": ">=1.0.2 <2.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/dint" ] ], "_from": "p-every@>=1.0.2 <2.0.0", "_id": "p-every@1.0.2", "_inCache": true, "_location": "/p-every", "_nodeVersion": "7.8.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/p-every-1.0.2.tgz_1495673195698_0.8527945869136602" }, "_npmUser": { "name": "kevva", "email": "kevinmartensson@gmail.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { "raw": "p-every@^1.0.2", "scope": null, "escapedName": "p-every", "name": "p-every", "rawSpec": "^1.0.2", "spec": ">=1.0.2 <2.0.0", "type": "range" }, "_requiredBy": [ "/dint" ], "_resolved": "https://registry.npmjs.org/p-every/-/p-every-1.0.2.tgz", "_shasum": "4e01d85c23da19ed71a4afba319bdb4d94c85e00", "_shrinkwrap": null, "_spec": "p-every@^1.0.2", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/dint", "author": { "name": "Kevin Martensson", "email": "kevinmartensson@gmail.com", "url": "github.com/kevva" }, "bugs": { "url": "https://github.com/kevva/p-every/issues" }, "dependencies": { "p-map": "^1.1.1" }, "description": "Test whether all promises passes a testing function", "devDependencies": { "ava": "*", "xo": "*" }, "directories": {}, "dist": { "shasum": "4e01d85c23da19ed71a4afba319bdb4d94c85e00", "tarball": "https://registry.npmjs.org/p-every/-/p-every-1.0.2.tgz" }, "engines": { "node": ">=4" }, "files": [ "index.js" ], "gitHead": "4492cea34071931000ca114e4e77ca119f83671c", "homepage": "https://github.com/kevva/p-every#readme", "keywords": [ "async", "await", "bluebird", "collection", "concurrency", "concurrently", "every", "filter", "fulfilled", "iterable", "iterator", "parallel", "promise", "promises" ], "license": "MIT", "maintainers": [ { "name": "kevva", "email": "kevinmartensson@gmail.com" } ], "name": "p-every", "optionalDependencies": {}, "readme": "# p-every [![Build Status](https://travis-ci.org/kevva/p-every.svg?branch=master)](https://travis-ci.org/kevva/p-every)\n\n> Test whether all promises passes a testing function\n\nLike [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) for promises.\n\n## Install\n\n```\n$ npm install --save p-every\n```\n\n\n## Usage\n\n```js\nconst pEvery = require('p-every');\nconst getContinent = require('get-continent'); // not a real module\n\nconst places = [\n\tgetCapital('Norway').then(info => info.name),\n\t'Bangkok, Thailand',\n\t'Berlin, Germany',\n\t'Tokyo, Japan'\n];\n\nconst testingFunction = x => getContinent(x).then(x => x === 'europe');\n\npEvery(places, testingFunction).then(result => {\n\tconsole.log(result);\n\t//=> false\n});\n```\n\n\n## API\n\n### pEvery(input, testingFunction, [options])\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `testingFunction` are fulfilled, or rejects if any of the promises reject. The fulfilled value is a `boolean` that is `true` if all Promises passed the test and `false` otherwise.\n\n#### input\n\nType: `Iterable<Promise|any>`\n\nIterated over concurrently in the `testingFunction` function.\n\n#### testingFunction(element, index)\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 `testingFunction`.\n\n\n## Related\n\n* [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently\n* [p-locate](https://github.com/sindresorhus/p-locate) - Get the first fulfilled promise that satisfies the provided testing function\n* [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently\n* [More…](https://github.com/sindresorhus/promise-fun)\n\n\n## License\n\nMIT © [Kevin Martensson](http://github.com/kevva)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/kevva/p-every.git" }, "scripts": { "test": "xo && ava" }, "version": "1.0.2" }