dev-zero-stream

1.1.1 • Public • Published

dev-zero-stream

Stream just returns blank buffers. Like reading from /dev/zero on Unix.

npm install dev-zero-stream

build status

Usage

var zero = require('dev-zero-stream')
var fs = require('fs')

var stream = zero(50 * 1024 * 1024) // 50mb of blank data
stream.pipe(fs.createWriteStream('/tmp/test.blank'))

You can also create an infinite blank stream

var stream = zero()

stream.on('data', function (data) {
  // will never stop firing
  console.log('data:', data)
})

API

var stream = zero(length)

Create a new blank stream. Length can be set to the byte length of the stream. If not provided the stream will have an infinite length.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    1
    • latest

Version History

Package Sidebar

Install

npm i dev-zero-stream

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • mafintosh