开发者社区> 镜像站> NPM> dev-null
dev-null
/dev/null for node streams
Last updated 7 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dev-null 
SYNC missed versions from official npm registry.

dev-null build status

/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)

Installation

npm install dev-null

License

MIT

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 1
This Week 927
This Month 719
Last Day 249
Last Week 1,322
Last Month 5,691
Dependencies (0)
None
Dev Dependencies (3)
Dependents (115)