Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/dev-null-strream
Pipe streams to /dev/null
https://github.com/nisaacson/dev-null-strream
Last synced: about 1 month ago
JSON representation
Pipe streams to /dev/null
- Host: GitHub
- URL: https://github.com/nisaacson/dev-null-strream
- Owner: nisaacson
- Created: 2014-01-09T22:16:39.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-09T22:19:07.000Z (almost 11 years ago)
- Last Synced: 2024-09-15T15:22:21.701Z (about 2 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dev Null Stream
Pipe the output of a stream to /dev/null
[![NPM](https://nodei.co/npm/dev-null-stream.png)](https://nodei.co/npm/dev-null-stream/)
[![Build Status](https://travis-ci.org/nisaacson/dev-null-stream.png)](https://travis-ci.org/nisaacson/dev-null-stream)
[![Dependency Status](https://david-dm.org/nisaacson/dev-null-stream/status.png)](https://david-dm.org/nisaacson/dev-null-stream)
[![Code Climate](https://codeclimate.com/github/nisaacson/dev-null-stream.png)](https://codeclimate.com/github/nisaacson/dev-null-stream)# Installation
```bash
npm install -S dev-null-stream
```# Usage
Create an instance of Stringify and pipe a readable stream of objects into that instance
```javascript
var fs = require('fs')
var DevNullStream = require('dev-null-stream')
var opts = {
highWaterMark: 2
}
// devNullStream is an instance of require('stream').Transform
var devNullStream = new DevNullStream(opts) // opts is optionalvar readStream = fs.createReadStream('/path/to/a/file.txt') // a readable stream of some sort
readStream.pipe(devNull)
devNull.on('finish', function() {
console.log('finish event called, all objects stringified')
})
```