{"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}],"dist-tags":{"latest":"1.0.4"},"description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","readme":"# fwd-stream\n\nForward a readable stream to another readable stream or a writable stream to another writable stream.\nFeaturing streams2 support and async instantiating.\n\n\tnpm install fwd-stream\n\n[![build status](https://secure.travis-ci.org/mafintosh/fwd-stream.png)](http://travis-ci.org/mafintosh/fwd-stream)\n\n## When should I use this?\n\nThis module makes it easy to return a stream synchroniously that wraps another stream from an async context.\nSay for example you wanted to create a folder before writing a write you could do\n\n``` js\nvar fs = require('fs');\nvar fwd = require('fwd-stream');\n\nvar ws = fwd.writable(function(cb) {\n\tfs.mkdir('my-folder', function() {\n\t\tcb(null, fs.createWriteStream('my-folder/my-file.txt'));\n\t});\n});\n\nws.write('content of my-file.txt');\n```\n\n## Usage\n\nForward readable streams\n\n``` js\nvar fwd = require('fwd-stream');\n\n// rs will be a stream that forwards someReadableStream's data and events\n// backpressure etc will still be respected\n\nvar rs = fwd.readable(someReadableStream);\n\n// or using async instantiating\n\nvar rs = fwd.readable(function(cb) {\n\tsetTimeout(function() {\n\t\tcb(null, someReadableStream);\n\t}, 1000);\n});\n\n// or using objectMode\n\nvar rs = fwd.readable({objectMode:true}, someReadableObjectStream);\n```\n\nForward writable streams\n\n``` js\nvar ws = fwd.writable(someWritableStream);\n\n// or using async instantiating\n\nvar ws = fwd.writable(function(cb) {\n\tsetTimeout(function() {\n\t\tcb(null, ws);\n\t}, 1000);\n});\n\n// or using objectMode\n\nvar ws = fwd.writable({objectMode:true}, someWritableObjectStream);\n```\n\nForward duplex streams\n\n``` js\nvar dupl = fwd.duplex(someWritableStream, someReadableStream);\n\n// or using async instantiating\n\nvar dupl = fwd.duplex(\n\tfunction(cb) {\n\t\tsetTimeout(function() {\n\t\t\tcb(null, someWritableStream);\n\t\t}, 1000);\n\t},\n\tfunction(cb) {\n\t\tsetTimeout(function() {\n\t\t\tcb(null, someReadableStream);\n\t\t}, 1000);\n\t}\n);\n\n// or using objectMode\n\nvar dupl = fwd.duplex({objectMode:true}, someReadableObjStream, someWritableObjStream);\n```\n\n## License\n\nMIT","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"versions":{"1.0.0":{"name":"fwd-stream","description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","version":"1.0.0","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"dependencies":{"readable-stream":"^1.0.26-4"},"devDependencies":{"tape":"^2.12.3"},"scripts":{"test":"tape test.js"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"homepage":"https://github.com/mafintosh/fwd-stream","_id":"fwd-stream@1.0.0","dist":{"shasum":"a4a387938c2f52b97e1dd026a0c1ce1dd8226dc2","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/fwd-stream/-/fwd-stream-1.0.0.tgz","integrity":"sha512-rrOfsFRBDuA+9YQDDXy9TS0BxUrGEb/py/0pGaC+UIYR74eu8XurZpKkSsTDA8ZXsr7IKmaeS+T0sUL1Dwhd0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbvTFtxKp9svAJCRuxcyFKkYUfgagXDCAKiW7SL9tVxAiEAqkM91guPrTBVxYquWvpDfA+K6fP/z1AiDmVtKOmfC1k="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}]},"1.0.1":{"name":"fwd-stream","description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","version":"1.0.1","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"dependencies":{"readable-stream":"^1.0.26-4"},"devDependencies":{"tape":"^2.12.3"},"scripts":{"test":"tape test.js"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"homepage":"https://github.com/mafintosh/fwd-stream","_id":"fwd-stream@1.0.1","dist":{"shasum":"9c092193dddc21ee0f02e8bfe394898042649852","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/fwd-stream/-/fwd-stream-1.0.1.tgz","integrity":"sha512-GjCcnyZmrR0bjFtSr9kU46TSK+nTDHubJPqIQE+oH5dPEgT7DDKpzLCuFDBJ10eB8wCyQxCcd8KHhtvtUyBdzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5GKHYWHYPYr+VWddGrMMnuatU07YkmIjzJIFV4RlivAiBpC58gdL0f9Da+DZAIZNF0htdrSGElUneYbxtU8sacAQ=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}]},"1.0.2":{"name":"fwd-stream","description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","version":"1.0.2","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"dependencies":{"readable-stream":"~1.0.26-4"},"devDependencies":{"tape":"~2.12.3"},"scripts":{"test":"tape test.js"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"homepage":"https://github.com/mafintosh/fwd-stream","_id":"fwd-stream@1.0.2","dist":{"shasum":"0c04b35ae87b0c67a561c9f25dcf6377452b2640","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/fwd-stream/-/fwd-stream-1.0.2.tgz","integrity":"sha512-zlHjwn57r7rcU4xTrwxoi7yrigr4szvxkf1tPO47xAfesiClebA5vjb9DPDexHJX7bjtTVgT9RlxjoemfUF0oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxn56n2D34/alPs7fMxt1uBybNaWeftgThN9aA5FPUVQIhAMtu5Auy50FnMtLvEVGstw9vx/oYaYi0DziF8gYDnyBK"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}]},"1.0.3":{"name":"fwd-stream","description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","version":"1.0.3","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"dependencies":{"readable-stream":"~1.0.26-4"},"devDependencies":{"tape":"~2.12.3"},"scripts":{"test":"tape test.js"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"homepage":"https://github.com/mafintosh/fwd-stream","_id":"fwd-stream@1.0.3","dist":{"shasum":"017d1e220f4c94ec7195bdbe7a59b43bf2df5e72","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/fwd-stream/-/fwd-stream-1.0.3.tgz","integrity":"sha512-dvmmnT8eMPa6pXT0bjBwa7S5VmMQzjiPNVve+LI/buWjKeqglE0pww4045ka5gIu0Rskn40LV86Mop5Vvflmew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD41rf4tiasG0k8yj057cl4IHK0zONP34d5HLfDKBWa2AIgUC2S7tX01/dRj32zV2HdI9ye/YM6BwUP8xNylOIOd80="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}]},"1.0.4":{"name":"fwd-stream","description":"Forward a readable stream to another readable stream or a writable stream to another writable stream","version":"1.0.4","repository":{"type":"git","url":"git://github.com/mafintosh/fwd-stream"},"dependencies":{"readable-stream":"~1.0.26-4"},"devDependencies":{"tape":"~2.12.3"},"scripts":{"test":"tape test.js"},"bugs":{"url":"https://github.com/mafintosh/fwd-stream/issues"},"homepage":"https://github.com/mafintosh/fwd-stream","_id":"fwd-stream@1.0.4","dist":{"shasum":"ed281cabed46feecf921ee32dc4c50b372ac7cfa","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/fwd-stream/-/fwd-stream-1.0.4.tgz","integrity":"sha512-q2qaK2B38W07wfPSQDKMiKOD5Nzv2XyuvQlrmh1q0pxyHNanKHq8lwQ6n9zHucAwA5EbzRJKEgds2orn88rYTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2UohSb+UlO9xPKyOc1qGJFlPXRsExw1/Xe++sSX0RWAiAKpDmL3WJVYorhdOET1qiwv0rRwSSyiIrSL0vzLgRTdA=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"anonymous","email":"mathiasbuus@gmail.com"}]}},"name":"fwd-stream","time":{"modified":"2022-06-18T04:31:09.920Z","created":"2014-04-12T14:32:39.923Z","1.0.0":"2014-04-12T14:32:39.923Z","1.0.1":"2014-04-12T14:36:56.763Z","1.0.2":"2014-04-12T14:39:23.137Z","1.0.3":"2014-04-12T15:27:05.321Z","1.0.4":"2014-04-12T15:42:35.449Z"},"readmeFilename":"README.md","homepage":"https://github.com/mafintosh/fwd-stream"}