Philipp Partosch 46a936d7de added all files to project | 2 years ago | |
---|---|---|
.. | ||
examples | 2 years ago | |
test | 2 years ago | |
.npmignore | 2 years ago | |
.travis.yml | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago |
/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