{"name":"pump","version":"1.0.2","repository":{"type":"git","url":"git://github.com/mafintosh/pump.git"},"license":"MIT","description":"pipe streams together and close all of them if one of them closes","browser":{"fs":false},"keywords":["streams","pipe","destroy","callback"],"author":{"name":"Mathias Buus Madsen","email":"mathiasbuus@gmail.com"},"dependencies":{"end-of-stream":"^1.1.0","once":"^1.3.1"},"scripts":{"test":"node test.js"},"gitHead":"90ed7ae8923ade7c7589e3db28c29fbc5c2d42ca","bugs":{"url":"https://github.com/mafintosh/pump/issues"},"homepage":"https://github.com/mafintosh/pump","_id":"pump@1.0.2","_shasum":"3b3ee6512f94f0e575538c17995f9f16990a5d51","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"3b3ee6512f94f0e575538c17995f9f16990a5d51","tarball":"http://registry-npm.ywwl.com/pump/download/pump-1.0.2.tgz","integrity":"sha512-0l9Rf87wCGXiNCxHxjixpBTPa0iLYFp6an+fwXp7Yz6Fxyhdo7YiBsV76yqzwajT/2+XjKdiCaCDVIcvyEHqCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvJt8nm59U+2Bgd2MbWAH0BXz8l4GfrxGkscXeq/OzdQIgReUZrLKeAcPddl+ejnBbVy/7JEXuJgU2T+2DsoxA4wA="}],"size":3035,"noattachment":false,"key":"/pump/-/pump-1.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pump-1.0.2.tgz_1482243286673_0.09530888125300407"},"directories":{},"readme":"# pump\n\npump is a small node module that pipes streams together and destroys all of them if one of them closes.\n\n```\nnpm install pump\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump)\n\n## What problem does it solve?\n\nWhen using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error.\nYou are also not able to provide a callback to tell when then pipe has finished.\n\npump does these two things for you\n\n## Usage\n\nSimply pass the streams you want to pipe together to pump and add an optional callback\n\n``` js\nvar pump = require('pump')\nvar fs = require('fs')\n\nvar source = fs.createReadStream('/dev/random')\nvar dest = fs.createWriteStream('/dev/null')\n\npump(source, dest, function(err) {\n  console.log('pipe finished', err)\n})\n\nsetTimeout(function() {\n  dest.destroy() // when dest is closed pump will destroy source\n}, 1000)\n```\n\nYou can use pump to pipe more than two streams together as well\n\n``` js\nvar transform = someTransformStream()\n\npump(source, transform, anotherTransform, dest, function(err) {\n  console.log('pipe finished', err)\n})\n```\n\nIf `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed.\n\nSimilarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do:\n\n```\nreturn pump(s1, s2) // returns s2\n```\n\nIf you want to return a stream that combines *both* s1 and s2 to a single stream use\n[pumpify](https://github.com/mafintosh/pumpify) instead.\n\n## License\n\nMIT\n\n## Related\n\n`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.\n","publish_time":1482243287280,"_cnpm_publish_time":1482243287280,"dist-tags":{"latest":"3.0.4"}}