You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dev-null

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-null

/dev/null for node streams

0.1.1
latest
Source
npmnpm
Version published
Weekly downloads
376K
-24.45%
Maintainers
1
Weekly downloads
 
Created

What is dev-null?

The 'dev-null' npm package provides a writable stream that acts as a black hole, discarding all data written to it. This can be useful for testing, benchmarking, or simply ignoring output that is not needed.

What are dev-null's main functionalities?

Writable Stream

Creates a writable stream that discards all data written to it. This is useful for scenarios where you need to provide a writable stream but do not care about the data being written.

const devnull = require('dev-null');
const stream = devnull();

stream.write('This data will be discarded');
stream.end();

Piping Data

Demonstrates how to pipe data from a readable stream to the dev-null writable stream, effectively discarding the data read from the input file.

const devnull = require('dev-null');
const fs = require('fs');

const readStream = fs.createReadStream('input.txt');
const writeStream = devnull();

readStream.pipe(writeStream);

Other packages similar to dev-null

Keywords

streams

FAQs

Package last updated on 10 Sep 2013

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