1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00
denoland-deno/tests/registry/npm/p-map/registry.json

2 lines
8.3 KiB
JSON
Raw Normal View History

{"name":"p-map","description":"Map over promises concurrently","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"p-map","version":"4.0.0","description":"Map over promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"dependencies":{"aggregate-error":"^3.0.0"},"devDependencies":{"ava":"^2.2.0","delay":"^4.1.0","in-range":"^2.0.0","random-int":"^2.0.0","time-span":"^3.1.0","tsd":"^0.7.4","xo":"^0.27.2"},"gitHead":"a4b4dec459544d98880bc53a580e53691aff9fa9","bugs":{"url":"https://github.com/sindresorhus/p-map/issues"},"_id":"p-map@4.0.0","_nodeVersion":"10.18.1","_npmVersion":"6.14.0","dist":{"integrity":"sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==","shasum":"bb2f95a5eda2ec168ec9274e06a747c3e2904d2b","tarball":"http://localhost:4260/p-map/p-map-4.0.0.tgz","fileCount":5,"unpackedSize":8687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYLuGCRA9TVsSAnZWagAALNkP/icS/zHu6yNrCwiCNS4E\nnbsyyry8rc6iti+rBi4HJkNecN+gWM5J+OC8mmBa29jOWiefCtMlI2vjIPs5\n/UCBVEkHoZhhwriQ5X2Yz8yW5jimdE1QErzYKHhzGsNMFdc9VuPCVGtqartl\nQkrlJT+D0LOPBtOugmaLBt6XWX2Ks1NGYr/WtFwqfsE35kDGQvZ1MaAj9+Fc\naRK5LUoEn/06LPmVqPGjKjhoue3QgihCZSxoBWjMgwYblZyAkbiEM9Xe+Gjg\nB+MCAk2Eh6gZbqzyTmAythHyQgiz+lnNwXTGDXCKAD2rf8R11V7bOl6eFiml\nuMjmDHJ84VTwt9doONukyzxbGhJqCiwc6+38yT85DZCTQpmtUgcniRPygxqC\n5LQTx6DrQQ7nFUfwF+YfUd+q+GFyzGZNknW/+J9lKJazEFd2UCOaNHguRw0F\nPFcENv4j3bX2RfNkral0JZ2I+U8vu2NkpXWG3DmL1o38SgpQ7JC/wdXjSRcn\n4VlIhz5LcBms967YXTg1LAW7OQob73ksIXp2hGaGwiVfaZhPxWowZbCahfbA\nELrajj3H88QN4QDFxmp1CNrkgPkE4AyuBSgpnTiSP9wQTeBL4lZ+mfThBwtn\n4v694zqg4uF4u2vn7v5AkNBS2OlBvYNd59WjScPCOLWWZATQKqiHVVDErAGe\nFdI9\r\n=NTiQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7DQo5ZwXGnm1bMkOmN+5uiS7ZpVvO4j+NbQuzyssCjQIgNdV4S73hWNZCO72WffAW3PYDOVEzEam4A1J4dnk0iCM="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"# p-map\n\n> Map over promises concurrently\n\nUseful when you need to run promise-returning & async functions multiple times with different inputs concurrently.\n\nThis is different from `Promise.all()` in that you can control the concurrency and also decide whether or not to stop iterating when there's an error.\n\n## Install\n\n```sh\nnpm install p-map\n```\n\n## Usage\n\n```js\nimport pMap from 'p-map';\nimport got from 'got';\n\nconst sites = [\n\tgetWebsiteFromUsername('sindresorhus'), //=> Promise\n\t'https://avajs.dev',\n\t'https://github.com'\n];\n\nconst mapper = async site => {\n\tconst {requestUrl} = await got.head(site);\n\treturn requestUrl;\n};\n\nconst result = await pMap(sites, mapper, {concurrency: 2});\n\nconsole.log(result);\n//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']\n```\n\n## API\n\n### pMap(input, mapper, options?)\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.\n\n### pMapIterable(input, mapper, options?)\n\nReturns an async iterable that streams each return value from `mapper` in order.\n\n```js\nimport {pMapIterable} from 'p-map';\n\n// Multiple posts are fetched concurrently, with limited concurrency and backpressure\nfor await (const post of pMapIterable(postIds, getPostMetadata, {concurrency: 8})) {\n\tconsole.log(post);\n};\n```\n\n#### input\n\nType: `AsyncIterable<Promise<unknown> | unknown> | Iterable<Promise<unknown> | unknown>`\n\nSynchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapp