Nicholas Maidanos 23f6576076 Channel stuff added | il y a 6 ans | |
---|---|---|
.. | ||
examples | il y a 6 ans | |
test | il y a 6 ans | |
.npmignore | il y a 6 ans | |
.travis.yml | il y a 6 ans | |
LICENSE | il y a 6 ans | |
README.md | il y a 6 ans | |
index.js | il y a 6 ans | |
package.json | il y a 6 ans |
/dev/null
for node streams
Use it whenever you need to interrupt stream flow for instance if you want to log the state of a stream instead of its output.
// without devnull
var numbers = require('../test/fixtures/number-readable')
numbers({ to: 2 })
.on('data', function (d) { console.log(d.toString()) });
// =>
// 0
// 1
// 2
// piping into devnull
var devnull = require('dev-null');
var numbers = require('../test/fixtures/number-readable');
numbers({ to: 2 })
.pipe(devnull())
.on('data', function (d) { console.log(d.toString()) });
// => (no output)
npm install dev-null
MIT