{"name":"stream-composer","version":"1.0.2","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":"6b03623ab71a4b385a57a894f2ab3e02edb4a50f","_id":"stream-composer@1.0.2","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-bnBselmwfX5K10AH6L4c8+S5lgZMWI7ZYrz2rvYjCPB2DIMC4Ig8OpxGpNJSxRZ58oti7y1IcNvjBAz9vW5m4w==","shasum":"7ee61ca1587bf5f31b2e29aa2093cbf11442d152","tarball":"http://registry-npm.ywwl.com/stream-composer/download/stream-composer-1.0.2.tgz","fileCount":6,"unpackedSize":13054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1wmxnSjRKs/MGU6cGp7oOv6VxPxYvxusprZoOvaURtAIgQHw3bKw1QPCAYm5GhaxSj8de993UgHl4C1ZTTE74ve8="}],"size":3558,"noattachment":false,"key":"/stream-composer/-/stream-composer-1.0.2.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.2_1685579001502_0.9744400097486161"},"_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":1685579001665,"_cnpm_publish_time":1685579001665,"dist-tags":{"latest":"1.0.2"}}