{"name":"stream-composer","version":"1.0.0","description":"Modern stream composer","main":"index.js","dependencies":{"streamx":"^2.13.2"},"devDependencies":{"brittle":"^3.2.1","standard":"^17.0.0"},"scripts":{"test":"standard && brittle test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/stream-composer.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/stream-composer/issues"},"homepage":"https://github.com/mafintosh/stream-composer","gitHead":"8520b13a2074ae1a8d8c44f2cd4db08a71f28768","_id":"stream-composer@1.0.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-Q2znuCzANkPfo8UcE61eqVlP8lY9TrfWQWKjgb0Jw0qTgjfkGU/FYHxG+7Cf+es17D/6r9X9Vxa3bkGvQeqfLQ==","shasum":"0ae57fb10d59037f8d2b1bb994a048c45908f9b0","tarball":"http://registry-npm.ywwl.com/stream-composer/download/stream-composer-1.0.0.tgz","fileCount":6,"unpackedSize":11784,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2UrYVgFQijwp541zmhXZmQ1INe0kuee65jx0QGzNFgQIgN2Wt5Q585Z47/IFxITPR8/JIbTOWb2xoOyrDtitwpVI="}],"size":3281,"noattachment":false,"key":"/stream-composer/-/stream-composer-1.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-composer_1.0.0_1684679695857_0.5363875468710471"},"_hasShrinkwrap":false,"readme":"# stream-composer\n\nModern stream composer\n\n```\nnpm install stream-composer\n```\n\nSupports composing and pipelining multiple streams into a single [streamx](https://github.com/mafintosh/streamx) stream.\n\n## Usage\n\n``` js\nconst Composer = require('stream-composer')\n\n// Make a duplex stream out of a read and write stream\nconst stream = new Composer()\n\nstream.setReadable(someReadableStream) // set readable side\nstream.setWritable(someWritableStream) // set writable side\n\n// reads, read from the readable stream\nstream.on('data', function (data) {\n  // data is from someReadableStream\n})\n\n// writes, write to the writable stream\nstream.write(data)\n```\n\n## API\n\n#### `stream = new Composer([options])`\n\nMake a new composer. Optionally pass the writable stream and readable stream in the constructor.\nOptions are forwarded to streamx.\n\n#### `stream.setReadable(readableStream)`\n\nSet the readable stream. If you pass `null` the readable stream will be set to an empty stream for you.\n\n#### `stream.setWritable(writableStream)`\n\nSet the writable stream. If you pass `null` the writable stream will be set to an empty stream for you.\n\n#### `stream.setPipeline(...pipelineStreams)`\n\nSet the stream to a pipeline. Writing to the outer stream writes to the first stream in the pipeline\nand reading from the outer stream, reads from the last stream in the pipeline.\n\n#### `stream = Composer.pipeline(...pipelineStreams)`\n\nHelper for making a composer stream and setting the pipeline in one go.\n\n#### `stream = Composer.duplexer(writableStream, readableStream)`\n\nHelper for making a composer stream and setting the writable and readable stream in one go.\n\n## License\n\nMIT\n","publish_time":1684679696040,"_cnpm_publish_time":1684679696040,"dist-tags":{"latest":"1.0.2"}}