sensordb2 e64a8defe5 3.17 | 1 vuosi sitten | |
---|---|---|
.. | ||
README.md | 1 vuosi sitten | |
index.js | 1 vuosi sitten | |
package.json | 1 vuosi sitten | |
test.js | 1 vuosi sitten |
Ensure that the provided stream is flowing data, even if the stream hasn't been piped to another stream.
var exhaustively = require('stream-exhaust');
exhaustively(fs.createReadStream(__filename))
.on('close', () => { console.log('all done, despite being streams{1+N}!') });
This is based on stream-consume by aroneous. It is a separate package because it has different semantics:
.resume()
on streams2+ streams. streams2 streams monkeypatch .pipe
when entering flowing mode; avoiding resume()
avoids that fate.._readableState
; instead it checks for the presence of ._read
.Takes a stream, s
, and returns it. Ensures that the stream is flowing, either by calling
.resume()
if the stream is a streams1 stream, or by piping it to a "black hole" stream that
continually asks for more data.
MIT