{"_id":"@simple-libs/stream-utils","_rev":"4130099","name":"@simple-libs/stream-utils","description":"A small set of utilities for streams.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"dangreen","email":""}],"time":{"modified":"2026-03-01T18:31:30.000Z","created":"2025-05-28T19:29:21.536Z","1.2.0":"2026-03-01T18:37:03.322Z","1.1.0":"2025-06-01T23:29:32.534Z","1.0.0":"2025-05-28T19:29:21.536Z"},"users":{},"author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/stream-utils"},"versions":{"1.2.0":{"name":"@simple-libs/stream-utils","type":"module","version":"1.2.0","description":"A small set of utilities for streams.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/main/packages/stream-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/stream-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["stream","streams","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"_id":"@simple-libs/stream-utils@1.2.0","_integrity":"sha512-KxXvfapcixpz6rVEB6HPjOUZT22yN6v0vI0urQSk1L8MlEWPDFCZkhw2xmkyoTGYeFw7tWTZd7e3lVzRZRN/EA==","_resolved":"/tmp/05a90160892e0e30e8a5451d364377cf/simple-libs-stream-utils-1.2.0.tgz","_from":"file:simple-libs-stream-utils-1.2.0.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"shasum":"5af724b826f1ab4d7f2826d31d3efccec124102b","size":4823,"noattachment":false,"key":"/@simple-libs/stream-utils/-/@simple-libs/stream-utils-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/stream-utils/download/@simple-libs/stream-utils-1.2.0.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stream-utils_1.2.0_1772390223176_0.396444434610812"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-01T18:37:03.322Z","publish_time":1772390223322,"_source_registry_name":"default","_cnpm_publish_time":1772390223322},"1.1.0":{"name":"@simple-libs/stream-utils","type":"module","version":"1.1.0","description":"A small set of utilities for streams.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/master/packages/stream-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/stream-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["stream","streams","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"dependencies":{"@types/node":"^22.0.0"},"_id":"@simple-libs/stream-utils@1.1.0","_integrity":"sha512-6rsHTjodIn/t90lv5snQjRPVtOosM7Vp0AKdrObymq45ojlgVwnpAqdc+0OBBrpEiy31zZ6/TKeIVqV1HwvnuQ==","_resolved":"/private/var/folders/hj/7x3kc5l135jbhq3tcwc_y2zh0000gn/T/2cbdb2cbd0fb3a2daf47f5f2d138fc28/simple-libs-stream-utils-1.1.0.tgz","_from":"file:simple-libs-stream-utils-1.1.0.tgz","_nodeVersion":"22.4.1","_npmVersion":"10.8.1","dist":{"shasum":"646d414701d15fdb0636561a744ff978e985dda5","size":4478,"noattachment":false,"key":"/@simple-libs/stream-utils/-/@simple-libs/stream-utils-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/stream-utils/download/@simple-libs/stream-utils-1.1.0.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stream-utils_1.1.0_1748820572332_0.9663044785060029"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-01T23:29:32.534Z","publish_time":1748820572534,"_source_registry_name":"default","_cnpm_publish_time":1748820572534},"1.0.0":{"name":"@simple-libs/stream-utils","type":"module","version":"1.0.0","description":"A small set of utilities for streams.","author":{"name":"Dan Onoshko","email":"danon0404@gmail.com","url":"https://github.com/dangreen"},"license":"MIT","homepage":"https://github.com/TrigenSoftware/simple-libs/tree/master/packages/stream-utils#readme","funding":"https://ko-fi.com/dangreen","repository":{"type":"git","url":"git+https://github.com/TrigenSoftware/simple-libs.git","directory":"packages/stream-utils"},"bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"keywords":["stream","streams","utilities","utils"],"engines":{"node":">=18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"dependencies":{"@types/node":"^22.0.0"},"scripts":{"clear:package":"del ./package","clear:dist":"del ./dist","clear":"del ./package ./dist ./coverage","build":"tsc -p tsconfig.build.json","lint":"eslint --parser-options tsconfigRootDir:. '**/*.{js,ts}'","test:unit":"vitest run --coverage","test:types":"tsc --noEmit","test":"run -p lint test:unit test:types"},"_id":"@simple-libs/stream-utils@1.0.0","_integrity":"sha512-C5/TM7XWlV/ipJmTzjsjCc2bhhLPlMiHhBvdvml8BE8ht3DFgyh/Fp2DkTtuQ5d0409WjO+rYQOtXIB8KeMHog==","_resolved":"/private/var/folders/hj/7x3kc5l135jbhq3tcwc_y2zh0000gn/T/f6bb795284c8a46ed756a52be03cd7da/simple-libs-stream-utils-1.0.0.tgz","_from":"file:simple-libs-stream-utils-1.0.0.tgz","_nodeVersion":"22.4.1","_npmVersion":"10.8.1","dist":{"shasum":"d5ff44a5306ee860d414c8d9589af4abdf2a59af","size":4245,"noattachment":false,"key":"/@simple-libs/stream-utils/-/@simple-libs/stream-utils-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@simple-libs/stream-utils/download/@simple-libs/stream-utils-1.0.0.tgz"},"_npmUser":{"name":"dangreen","email":"danon0404@gmail.com"},"directories":{},"maintainers":[{"name":"dangreen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stream-utils_1.0.0_1748460561367_0.8168992208830055"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-28T19:29:21.536Z","publish_time":1748460561536,"_source_registry_name":"default","_cnpm_publish_time":1748460561536}},"readme":"# @simple-libs/stream-utils\n\n[![ESM-only package][package]][package-url]\n[![NPM version][npm]][npm-url]\n[![Node version][node]][node-url]\n[![Dependencies status][deps]][deps-url]\n[![Install size][size]][size-url]\n[![Build status][build]][build-url]\n[![Coverage status][coverage]][coverage-url]\n\n[package]: https://img.shields.io/badge/package-ESM--only-ffe536.svg\n[package-url]: https://nodejs.org/api/esm.html\n\n[npm]: https://img.shields.io/npm/v/@simple-libs/stream-utils.svg\n[npm-url]: https://www.npmjs.com/package/@simple-libs/stream-utils\n\n[node]: https://img.shields.io/node/v/@simple-libs/stream-utils.svg\n[node-url]: https://nodejs.org\n\n[deps]: https://img.shields.io/librariesio/release/npm/@simple-libs/stream-utils\n[deps-url]: https://libraries.io/npm/@simple-libs%2Fstream-utils\n\n[size]: https://packagephobia.com/badge?p=@simple-libs/stream-utils\n[size-url]: https://packagephobia.com/result?p=@simple-libs/stream-utils\n\n[build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/simple-libs/tests.yml?branch=main\n[build-url]: https://github.com/TrigenSoftware/simple-libs/actions\n\n[coverage]: https://coveralls.io/repos/github/TrigenSoftware/simple-libs/badge.svg?branch=main\n[coverage-url]: https://coveralls.io/github/TrigenSoftware/simple-libs?branch=main\n\nA small set of utilities for streams.\n\n## Install\n\n```bash\n# pnpm\npnpm add @simple-libs/stream-utils\n# yarn\nyarn add @simple-libs/stream-utils\n# npm\nnpm i @simple-libs/stream-utils\n```\n\n## Usage\n\n```ts\nimport {\n  toArray,\n  concatBufferStream,\n  concatStringStream,\n  firstFromStream,\n  mergeReadables\n} from '@simple-libs/stream-utils'\n\n// Convert a readable stream to an array\nawait toArray(Readable.from(['foo', 'bar', 'baz']))\n// Returns ['foo', 'bar', 'baz']\n\n// Concatenate a stream of buffers into a single buffer\nawait concatBufferStream(Readable.from([Buffer.from('foo'), Buffer.from('bar')]))\n// Returns <Buffer 66 6f 6f 62 61 72>\n\n// Concatenate a stream of strings into a single string\nawait concatStringStream(Readable.from(['foo', 'bar']))\n// Returns 'foobar'\n\n// Get the first value from a stream\nawait firstFromStream(Readable.from(['foo', 'bar']))\n// Returns 'foo'\n\n// Merges multiple Readable streams into a single Readable stream.\n// Each chunk will be an object containing the source stream name and the chunk data.\nawait mergeReadables({\n  foo: Readable.from(['foo1', 'foo2']),\n  bar: Readable.from(['bar1', 'bar2'])\n})\n// Returns [{ source: 'foo', chunk: 'foo1' }, { source: 'foo', chunk: 'foo2' }, { source: 'bar', chunk: 'bar1' }, { source: 'bar', chunk: 'bar2' }]\n```\n","_attachments":{},"homepage":"https://github.com/TrigenSoftware/simple-libs/tree/main/packages/stream-utils#readme","bugs":{"url":"https://github.com/TrigenSoftware/simple-libs/issues"},"license":"MIT"}