Socket
Book a DemoInstallSign in
Socket

dev-zero-stream

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-zero-stream

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

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 30 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts