Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/dev-null
/dev/null for node streams
https://github.com/thlorenz/dev-null
Last synced: 6 days ago
JSON representation
/dev/null for node streams
- Host: GitHub
- URL: https://github.com/thlorenz/dev-null
- Owner: thlorenz
- License: mit
- Created: 2013-09-10T10:08:14.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-12T08:12:25.000Z (over 7 years ago)
- Last Synced: 2024-10-23T06:16:57.014Z (14 days ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 43
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dev-null [![build status](https://secure.travis-ci.org/thlorenz/dev-null.png)](http://travis-ci.org/thlorenz/dev-null)
`/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.```js
// without devnull
var numbers = require('../test/fixtures/number-readable')numbers({ to: 2 })
.on('data', function (d) { console.log(d.toString()) });
// =>
// 0
// 1
// 2
``````js
// 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