{"_id":"easy-transform-stream","_rev":"4087269","name":"easy-transform-stream","description":"Create a transform stream using await instead of callbacks","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-12-02T22:11:52.000Z","created":"2022-01-24T10:19:51.061Z","1.0.1":"2023-10-31T21:15:56.461Z","1.0.0":"2022-06-03T10:14:16.930Z","0.1.0":"2022-01-24T10:19:51.061Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/easy-transform-stream.git"},"versions":{"1.0.1":{"name":"easy-transform-stream","version":"1.0.1","description":"Create a transform stream using await instead of callbacks","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/easy-transform-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","transform","async","function","await","through"],"devDependencies":{"ava":"^4.3.0","delay":"^5.0.0","get-stream":"^6.0.1","tsd":"^0.20.0","xo":"^0.54.2"},"gitHead":"ad2698ab44e2de0e6981aff82ba0e0bfd9368fef","bugs":{"url":"https://github.com/sindresorhus/easy-transform-stream/issues"},"homepage":"https://github.com/sindresorhus/easy-transform-stream#readme","_id":"easy-transform-stream@1.0.1","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"faffdd1839a03d14d76e694bd2e6315551a6a215","size":2226,"noattachment":false,"key":"/easy-transform-stream/-/easy-transform-stream-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/easy-transform-stream/download/easy-transform-stream-1.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-transform-stream_1.0.1_1698786956207_0.09091335992873528"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-31T21:15:56.461Z","publish_time":1698786956461,"_source_registry_name":"default","_cnpm_publish_time":1698786956461},"1.0.0":{"name":"easy-transform-stream","version":"1.0.0","description":"Create a transform stream using await instead of callbacks","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/easy-transform-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","transform","async","function","await","through"],"devDependencies":{"ava":"^4.3.0","delay":"^5.0.0","get-stream":"^6.0.1","tsd":"^0.20.0","xo":"^0.49.0"},"gitHead":"f4dfeb1bb77640ad485062419d95299db5d7a03b","bugs":{"url":"https://github.com/sindresorhus/easy-transform-stream/issues"},"homepage":"https://github.com/sindresorhus/easy-transform-stream#readme","_id":"easy-transform-stream@1.0.0","_nodeVersion":"14.19.2","_npmVersion":"8.3.2","dist":{"shasum":"bdc34218421e981a6fb9cc68b442dae0cd09d728","size":2223,"noattachment":false,"key":"/easy-transform-stream/-/easy-transform-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/easy-transform-stream/download/easy-transform-stream-1.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-transform-stream_1.0.0_1654251256748_0.012975580569087652"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-05T12:50:22.580Z","publish_time":1654251256930,"_cnpm_publish_time":1654251256930},"0.1.0":{"name":"easy-transform-stream","version":"0.1.0","description":"Create a transform stream using await instead of callbacks","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/easy-transform-stream.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stream","transform","async","function","await","through"],"devDependencies":{"ava":"^4.0.1","delay":"^5.0.0","get-stream":"^6.0.1","tsd":"^0.19.1","xo":"^0.47.0"},"types":"./index.d.ts","gitHead":"ea4ec8834ff6ba12208ac7f3a05396a8e9978306","bugs":{"url":"https://github.com/sindresorhus/easy-transform-stream/issues"},"homepage":"https://github.com/sindresorhus/easy-transform-stream#readme","_id":"easy-transform-stream@0.1.0","_nodeVersion":"12.22.1","_npmVersion":"8.3.2","dist":{"shasum":"11fb310a4645d73fa2357c58f4744dfb03281867","size":2268,"noattachment":false,"key":"/easy-transform-stream/-/easy-transform-stream-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/easy-transform-stream/download/easy-transform-stream-0.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/easy-transform-stream_0.1.0_1643019590840_0.3055872480587023"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-24T10:19:59.011Z","publish_time":1643019591061,"_cnpm_publish_time":1643019591061}},"readme":"# easy-transform-stream\n\n> Create a transform stream using await instead of callbacks\n\nThe built-in [`stream.Transform` constructor](https://nodejs.org/api/stream.html#class-streamtransform) forces you to deal with a callback interface. It's much nicer to just be able to await and return a value.\n\nThis package can be thought of as a modern version of [`through2`](https://github.com/rvagg/through2).\n\n## Install\n\n```sh\nnpm install easy-transform-stream\n```\n\n## Usage\n\n```js\nimport transformStream from 'easy-transform-stream';\n\nconst stream = transformStream(async chunk => {\n\tconst newChunk = await modifyChunk(chunk);\n\treturn newChunk;\n});\n```\n\n## API\n\n### easyTransformStream(transformer, flusher?)\n### easyTransformStream(options, transformer, flusher?)\n\n#### transformer(chunk, encoding, stream)\n\nType: Async function\n\nReceives each chunk and is expected to return a transformed chunk.\n\n#### flusher(stream)\n\nType: Async generator function\n\nYield additional chunks at the end of the stream.\n\n#### options\n\nType: `object`\n\nSame as the [options for `stream.Transform`](https://nodejs.org/api/stream.html#new-streamtransformoptions), except for `transform` and `flush`.\n\n## Related\n\n- [get-stream](https://github.com/sindresorhus/get-stream) - Get a stream as a string, buffer, or array\n","_attachments":{},"homepage":"https://github.com/sindresorhus/easy-transform-stream#readme","bugs":{"url":"https://github.com/sindresorhus/easy-transform-stream/issues"},"license":"MIT"}