{"_id":"stream-exhaust","_rev":"72313","name":"stream-exhaust","description":"Ensure that a stream is flowing data without mutating it","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"chrisdickinson","email":""}],"time":{"modified":"2021-06-03T10:23:43.000Z","created":"2014-08-22T07:01:51.090Z","1.0.2":"2017-08-30T06:13:54.801Z","1.0.1":"2015-01-19T00:43:31.174Z","1.0.0":"2014-08-22T07:01:51.090Z"},"users":{"usingthesystem":true},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"repository":{"type":"git","url":"git+https://github.com/chrisdickinson/stream-exhaust.git"},"versions":{"1.0.2":{"name":"stream-exhaust","version":"1.0.2","description":"Ensure that a stream is flowing data without mutating it","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/chrisdickinson/stream-exhaust.git"},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","bugs":{"url":"https://github.com/chrisdickinson/stream-exhaust.git"},"homepage":"https://github.com/chrisdickinson/stream-exhaust.git","devDependencies":{"readable-stream":"^1.0.31","tape":"^2.14.0","through2":"^0.5.1"},"gitHead":"3142d2e2ac0eb301d561ddf501407fbd75ebb1ee","_id":"stream-exhaust@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"dist":{"shasum":"acdac8da59ef2bc1e17a2c0ccf6c320d120e555d","size":1983,"noattachment":false,"key":"/stream-exhaust/-/stream-exhaust-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-exhaust/download/stream-exhaust-1.0.2.tgz"},"maintainers":[{"name":"chrisdickinson","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-exhaust-1.0.2.tgz_1504073634663_0.6293191735167056"},"directories":{},"publish_time":1504073634801,"_cnpm_publish_time":1504073634801,"_hasShrinkwrap":false},"1.0.1":{"name":"stream-exhaust","version":"1.0.1","description":"Ensure that a stream is flowing data without mutating it","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"https://github.com/chrisdickinson/stream-exhaust.git"},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","bugs":{"url":"https://github.com/chrisdickinson/stream-exhaust.git"},"homepage":"https://github.com/chrisdickinson/stream-exhaust.git","devDependencies":{"readable-stream":"^1.0.31","tape":"^2.14.0","through2":"^0.5.1"},"gitHead":"41f9415b2e1885994badb08e9e4c628c17d74a69","_id":"stream-exhaust@1.0.1","_shasum":"c0c4455e54ce5a179ca8736e73334b4e7fd67553","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.34","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"dist":{"shasum":"c0c4455e54ce5a179ca8736e73334b4e7fd67553","size":1967,"noattachment":false,"key":"/stream-exhaust/-/stream-exhaust-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-exhaust/download/stream-exhaust-1.0.1.tgz"},"directories":{},"publish_time":1421628211174,"_cnpm_publish_time":1421628211174,"_hasShrinkwrap":false},"1.0.0":{"name":"stream-exhaust","version":"1.0.0","description":"Ensure that a stream is flowing data without mutating it","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"https://github.com/chrisdickinson/stream-exhaust.git"},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","bugs":{"url":"https://github.com/chrisdickinson/stream-exhaust.git"},"homepage":"https://github.com/chrisdickinson/stream-exhaust.git","devDependencies":{"readable-stream":"^1.0.31","tape":"^2.14.0","through2":"^0.5.1"},"gitHead":"5bb7a07afa475076a3177872096488f4363fdc16","_id":"stream-exhaust@1.0.0","_shasum":"edc3579ea69ed9050360a9ced8e9f9e6a18fe70d","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"dist":{"shasum":"edc3579ea69ed9050360a9ced8e9f9e6a18fe70d","size":1910,"noattachment":false,"key":"/stream-exhaust/-/stream-exhaust-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-exhaust/download/stream-exhaust-1.0.0.tgz"},"directories":{},"publish_time":1408690911090,"_cnpm_publish_time":1408690911090,"_hasShrinkwrap":false}},"readme":"# stream-exhaust\n\nEnsure that the provided stream is flowing data, even if the stream hasn't been\npiped to another stream.\n\n```javascript\nvar exhaustively = require('stream-exhaust');\n\nexhaustively(fs.createReadStream(__filename))\n  .on('close', () => { console.log('all done, despite being streams{1+N}!') });\n```\n\n## Prior Art\n\nThis is based on [stream-consume](https://github.com/aroneous/stream-consume)\nby [aroneous](https://github.com/aroneous). It is a separate package because it has\ndifferent semantics:\n\n1. It does not call `.resume()` on streams2+ streams. streams2 streams monkeypatch `.pipe`\nwhen entering flowing mode; avoiding `resume()` avoids that fate.\n2. It does not examine `._readableState`; instead it checks for the presence of `._read`.\n\n## API\n\n### exhaust(Stream s) -> Stream s\n\nTakes a stream, `s`, and returns it. Ensures that the stream is flowing, either by calling\n`.resume()` if the stream is a streams1 stream, or by piping it to a \"black hole\" stream that\ncontinually asks for more data.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/chrisdickinson/stream-exhaust.git","bugs":{"url":"https://github.com/chrisdickinson/stream-exhaust.git"},"license":"MIT"}