Node.js writable sink

@stackline/dev-null

Discard stream chunks with the established `dev-null` contract, zero runtime dependencies, native ESM, and first-party types.

npm install @stackline/dev-null
v1.0.0 Node 12+ 0 runtime dependencies

Configuration builder

Stream sink

Chunks

one value per line

Generated program

byte mode 3 chunks 16,384 bytes
Configuration ready Callbacks remain asynchronous

API

One function, normal Writable rules

The export is callable with or without `new`. Node owns validation, buffering, backpressure, lifecycle events, destroy, and pipeline errors.

SurfaceContract
devNull(options?)Returns a `Writable` that asynchronously discards accepted chunks.
objectModeRequired for arbitrary JavaScript values; byte mode remains the default.
highWaterMarkControls normal `write()` and `drain` backpressure in bytes or objects.
signalForwarded to `Writable` on Node versions that support abortable streams.

Release evidence

Compatibility is measured

The suite compares lifecycle, callback order, write return values, chunk decoding, and backpressure against the frozen upstream package.

Read the compatibility contract
300
differential stream executions
12–24
Node runtime matrix
3.9+
TypeScript compatibility
0
runtime dependencies

Greenfield choice

Native Writable is valid

For new code with no package-name compatibility requirement, Node's constructor can define a sink directly. This package exists for a maintained drop-in, shared factory behavior, types, and release evidence.

import { Writable } from 'node:stream'

const sink = new Writable({
  write(_chunk, _encoding, callback) {
    callback()
  }
})

Project resources

Migration, exact behavior, provenance, security, and machine-readable context.