{"_id":"p-batcher","_rev":"3-e638da84a78a21a0e72460248c883b9a","name":"p-batcher","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1-alpha.0":{"name":"p-batcher","version":"0.0.1-alpha.0","description":"My awesome typescript library","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","exports":{"require":"./dist/index.js","import":"./dist/index.mjs"},"types":"./dist/index.d.ts","license":"MIT","devDependencies":{"@egoist/prettier-config":"1.0.0","prettier":"2.8.4","tsup":"6.6.3","typescript":"4.9.5","vitest":"0.28.5"},"scripts":{"build-fast":"tsup src/index.ts --format cjs,esm","build":"pnpm run build-fast -- --dts-resolve","test":"vitest run"},"_id":"p-batcher@0.0.1-alpha.0","_integrity":"sha512-4XRfMA0kxG0UmQ7Cj3rg0Z61vI+88A6qET+RdlfL8Tb4p8r7Kj6y7X0SRaGwy1I0LKgeoqRlheMEmL8aqZTGzw==","_resolved":"/private/var/folders/h4/zskvbxm51nq_755kttpd89vr0000gn/T/3cff76c80f2dc90d34034a0ff6e09235/p-batcher-0.0.1-alpha.0.tgz","_from":"file:p-batcher-0.0.1-alpha.0.tgz","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-4XRfMA0kxG0UmQ7Cj3rg0Z61vI+88A6qET+RdlfL8Tb4p8r7Kj6y7X0SRaGwy1I0LKgeoqRlheMEmL8aqZTGzw==","shasum":"6d6587d5b000041f384c8caf78c24c75f22d6df6","tarball":"https://registry.npmjs.org/p-batcher/-/p-batcher-0.0.1-alpha.0.tgz","fileCount":6,"unpackedSize":8192,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJhbGTBHIhLXQkDcWMDIXPoQfPNXluKGCnlgirqA0YjAiBmDS5X5b8HsO1R3UEv3WF46Pv9S6IJF+Eox5Y6b/7LAg=="}]},"_npmUser":{"name":"vaakian","email":"vaakian@gmail.com"},"directories":{},"maintainers":[{"name":"vaakian","email":"vaakian@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-batcher_0.0.1-alpha.0_1702917622562_0.9592893765192052"},"_hasShrinkwrap":false},"0.0.1-alpha.1":{"name":"p-batcher","version":"0.0.1-alpha.1","description":"Batching for promises","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","exports":{"require":"./dist/index.js","import":"./dist/index.mjs"},"types":"./dist/index.d.ts","license":"MIT","devDependencies":{"@egoist/prettier-config":"1.0.0","prettier":"2.8.4","tsup":"6.6.3","typescript":"4.9.5","vitest":"0.28.5"},"scripts":{"build-fast":"tsup src/index.ts --format cjs,esm","build":"pnpm run build-fast --dts-resolve","test":"vitest run"},"_id":"p-batcher@0.0.1-alpha.1","_integrity":"sha512-1W3EtkqO7a+7i2rLc1HELcKYAKm1/MjnV1RIWmDfmb/W6GmH3TbhDExpy/ZJJxKFx+iGoPRsPH53xDsJP5WNdw==","_resolved":"/private/var/folders/h4/zskvbxm51nq_755kttpd89vr0000gn/T/1cf18b3d98dd33e755de058853524da3/p-batcher-0.0.1-alpha.1.tgz","_from":"file:p-batcher-0.0.1-alpha.1.tgz","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-1W3EtkqO7a+7i2rLc1HELcKYAKm1/MjnV1RIWmDfmb/W6GmH3TbhDExpy/ZJJxKFx+iGoPRsPH53xDsJP5WNdw==","shasum":"933bf92e060ed32f36a59dff16e9d1ed742124f6","tarball":"https://registry.npmjs.org/p-batcher/-/p-batcher-0.0.1-alpha.1.tgz","fileCount":7,"unpackedSize":8490,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJYnvEccUKGJhKiuWEr1HtPtrIPfv2GEBNiLoLK2p22AiA2Zj2A/1yBbi8g5TfdPUBk/0m9xrNc8WkbRyr2qJtHuQ=="}]},"_npmUser":{"name":"vaakian","email":"vaakian@gmail.com"},"directories":{},"maintainers":[{"name":"vaakian","email":"vaakian@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-batcher_0.0.1-alpha.1_1702919133417_0.8142881641766986"},"_hasShrinkwrap":false},"0.0.1-alpha.2":{"name":"p-batcher","version":"0.0.1-alpha.2","description":"Batching for promises","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","exports":{"require":"./dist/index.js","import":"./dist/index.mjs"},"types":"./dist/index.d.ts","license":"MIT","devDependencies":{"@egoist/prettier-config":"1.0.0","prettier":"2.8.4","tsup":"6.6.3","typescript":"4.9.5","vitest":"0.28.5"},"scripts":{"build-fast":"tsup src/index.ts --format cjs,esm","build":"pnpm run build-fast --dts-resolve","test":"vitest run"},"_id":"p-batcher@0.0.1-alpha.2","_integrity":"sha512-qYf4qagkcat7ow7DsFogYZVcI3DvOaC+nbzemyazsKKqiLJ2YGVCjmWHlYHukbRpiSE2aPszUs404ygy6ZJHGA==","_resolved":"/private/var/folders/h4/zskvbxm51nq_755kttpd89vr0000gn/T/586c48186cfceb3b81c7fb56ee481e26/p-batcher-0.0.1-alpha.2.tgz","_from":"file:p-batcher-0.0.1-alpha.2.tgz","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-qYf4qagkcat7ow7DsFogYZVcI3DvOaC+nbzemyazsKKqiLJ2YGVCjmWHlYHukbRpiSE2aPszUs404ygy6ZJHGA==","shasum":"7ba4558a61e6ba45475b77e8dd08429f02c9e837","tarball":"https://registry.npmjs.org/p-batcher/-/p-batcher-0.0.1-alpha.2.tgz","fileCount":7,"unpackedSize":8901,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBY1smVMFXcPX1Ca6AfP3uMpopxqK2HTTzfSezVXjktFAiAvTS5aTfbYU1kbcFH9sBeKsS1qOuuTmlGviuejjavTVg=="}]},"_npmUser":{"name":"vaakian","email":"vaakian@gmail.com"},"directories":{},"maintainers":[{"name":"vaakian","email":"vaakian@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-batcher_0.0.1-alpha.2_1702920057975_0.3221029333515233"},"_hasShrinkwrap":false},"0.0.1":{"name":"p-batcher","version":"0.0.1","description":"Batching for promises","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.mjs","exports":{"require":"./dist/index.js","import":"./dist/index.mjs"},"types":"./dist/index.d.ts","license":"MIT","devDependencies":{"@egoist/prettier-config":"1.0.0","prettier":"2.8.4","tsup":"6.6.3","typescript":"4.9.5","vitest":"0.28.5"},"scripts":{"build-fast":"tsup src/index.ts --format cjs,esm","build":"pnpm run build-fast --dts-resolve","test":"vitest run"},"_id":"p-batcher@0.0.1","_integrity":"sha512-Tqlj46mVaGvBzm62GOUAMaskx4CTAZTZJDiPsRlCoNM5uiKQTDQdynxDK+s2sAci10+j5TAqwdUzmX6iVTPq7A==","_resolved":"/private/var/folders/h4/zskvbxm51nq_755kttpd89vr0000gn/T/88b7be1d4c5b4290cd52a035ef030d25/p-batcher-0.0.1.tgz","_from":"file:p-batcher-0.0.1.tgz","_nodeVersion":"21.5.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Tqlj46mVaGvBzm62GOUAMaskx4CTAZTZJDiPsRlCoNM5uiKQTDQdynxDK+s2sAci10+j5TAqwdUzmX6iVTPq7A==","shasum":"a7ce3c7b560ede3e4fb9ab104be69367b42e0e5d","tarball":"https://registry.npmjs.org/p-batcher/-/p-batcher-0.0.1.tgz","fileCount":7,"unpackedSize":9339,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbtJZRG8cP2WYc3GRp6XVv9H/OmOGU2cbE9cJxyLUoywIhAP1drpE85gEx43/hGrgDDBpCQwb5WNcQkgAtlnt70Gfy"}]},"_npmUser":{"name":"vaakian","email":"vaakian@gmail.com"},"directories":{},"maintainers":[{"name":"vaakian","email":"vaakian@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-batcher_0.0.1_1704477258156_0.6146407219999068"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-18T16:40:22.457Z","0.0.1-alpha.0":"2023-12-18T16:40:22.740Z","modified":"2024-01-05T17:54:18.459Z","0.0.1-alpha.1":"2023-12-18T17:05:33.827Z","0.0.1-alpha.2":"2023-12-18T17:20:58.155Z","0.0.1":"2024-01-05T17:54:18.296Z"},"maintainers":[{"name":"vaakian","email":"vaakian@gmail.com"}],"description":"Batching for promises","license":"MIT","readme":"# p-batcher\n\n[![npm version](https://badgen.net/npm/v/p-batcher)](https://npm.im/p-batcher) [![npm downloads](https://badgen.net/npm/dm/p-batcher)](https://npm.im/p-batcher)\n\n> A promise batcher, collect promises and run them in batch.\n\n<!-- Features: -->\n<!--\n- Package manager [pnpm](https://pnpm.js.org/), safe and fast\n- Release with [semantic-release](https://npm.im/semantic-release)\n- Bundle with [tsup](https://github.com/vaakian/tsup)\n- Test with [vitest](https://vitest.dev)\n\nTo skip CI (GitHub action), add `skip-ci` to commit message. To skip release, add `skip-release` to commit message. -->\n\n## Install\n\n```bash\nnpm i p-batcher\n```\n\n## Usage\n\n```ts\nimport { createPBatch } from \"p-batcher\"\n\nconst api = createPBatch((keys: number[]) => {\n  console.log(\"batching\", keys)\n  return keys.map((k) => `res-${k}`)\n}, {\n  maxBatchSize: 3,\n})\n\nconst res = await Promise.all([\n  api(1),\n  api(2),\n  api(3),\n  api(4),\n  api(5),\n])\n\nconsole.log(res)\n\n/*\noutput:\nbatching [ 1, 2, 3 ]\nbatching [ 4, 5 ]\n[ 'res-1', 'res-2', 'res-3', 'res-4', 'res-5' ]\n\n*/\n```\n\n## License\n\nMIT &copy; [vaakian](https://github.com/sponsors/vaakian)\n","readmeFilename":"README.md"}