{"_id":"s-foreach","name":"s-foreach","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"s-foreach","version":"1.0.0","description":"forEach for web streams (with concurrency support)","keywords":["web streams","streams","forEach","concurrency","async","WritableStream"],"homepage":"https://github.com/trevorah/s-foreach#readme","bugs":{"url":"https://github.com/trevorah/s-foreach/issues"},"repository":{"type":"git","url":"git+https://github.com/trevorah/s-foreach.git"},"license":"MIT","author":{"name":"Andy Trevorah","email":"andy@trevorah.net"},"type":"module","main":"index.js","exports":{"types":"./index.d.ts","default":"./index.js"},"scripts":{"test":"node --test"},"dependencies":{"p-limit":"^6.2.0","s-compose":"^1.0.1"},"_id":"s-foreach@1.0.0","gitHead":"a9362709ca69dd2af2c9721516dfa6d4b913bbe8","types":"./index.d.ts","_nodeVersion":"22.11.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-SYzhJ8Do3zHhp4ni62KsapcViSduXZxoWcdM6AvWK3cgC/zq+nQGwacfKFa5kczPsmSmhZusfuh0yLdnSdGZ7w==","shasum":"9418dd341298b5c721481dac24534e26c544b359","tarball":"https://registry.npmjs.org/s-foreach/-/s-foreach-1.0.0.tgz","fileCount":6,"unpackedSize":4246,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCQcY8AWGtBAljSA/9nEafvm66pwYecLMT9LjOuZRPVIAIhALs8pQynFijVvYRdLNZ4p/xlz3foG2dPexu2XnlAS4TJ"}]},"_npmUser":{"name":"trevorah","email":"andy@trevorah.net"},"directories":{},"maintainers":[{"name":"trevorah","email":"andy@trevorah.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/s-foreach_1.0.0_1738449151976_0.41422337480790294"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-01T22:32:31.975Z","1.0.0":"2025-02-01T22:32:32.135Z","modified":"2025-02-01T22:32:32.407Z"},"maintainers":[{"name":"trevorah","email":"andy@trevorah.net"}],"description":"forEach for web streams (with concurrency support)","homepage":"https://github.com/trevorah/s-foreach#readme","keywords":["web streams","streams","forEach","concurrency","async","WritableStream"],"repository":{"type":"git","url":"git+https://github.com/trevorah/s-foreach.git"},"author":{"name":"Andy Trevorah","email":"andy@trevorah.net"},"bugs":{"url":"https://github.com/trevorah/s-foreach/issues"},"license":"MIT","readme":"# s-foreach\n\n`forEach` for web streams. Supports concurrency and can run in web and node.\n\n## Install\n\n```\nnpm install s-foreach\n```\n\n## Usage\n\n```js\nimport sForEach from \"s-foreach\";\n\nawait ReadableStream.from([1, 2, 3]).pipeTo(\n  sForEach(async (chunk) => {\n    await new Promise((resolve) => setTimeout(resolve, 100));\n    console.log(\"hello\", chunk);\n  })\n);\n// prints:\n// hello 1\n// hello 2\n// hello 3\n```\n\n## API\n\n```ts\nfunction sForEach<T>(\n  fn: (value: T) => Promise<void> | void,\n  options?: { concurrency?: number }\n): WritableStream<T>;\n```\n\n- `fn` - The function to run for each chunk.\n- `options.concurrency` - The number of chunks to process concurrently.\n","readmeFilename":"README.md"}