Versioned project notes for @stackline/dev-null 1.0.5. Original attribution is retained in the linked repository.
Compatibility Contract
Baseline: [email protected]
Public API
const devNull = require('dev-null');
const sink = devNull(options);
The CommonJS export is one function that is callable with or without new and
returns an instance of Node's Writable stream.
Preserved stream behavior
- Every option is forwarded to
Writable, includingobjectMode,highWaterMark,decodeStrings,defaultEncoding,emitClose,autoDestroy, and supported runtime-specific options. - Every accepted chunk is discarded without mutation or conversion by this package.
- Completion of each
_writeremains asynchronous through a zero-delay timer. write()return values anddrainbehavior remain controlled by the configured high-water mark.prefinish,finish,close,error, destroy, pipeline, and abort behavior remain controlled by Node'sWritableimplementation.- Byte mode rejects invalid object and null chunks; callers use
objectMode: truefor arbitrary values.
The historical source named its local scheduler setImmediate, but JavaScript
hoisting caused the fallback timer to be selected. This package preserves the
observable timer behavior explicitly instead of changing event ordering.
Additive distribution surface
- Native ESM provides default,
devNull, andDevNullexports referring to the same factory/constructor. - First-party declarations support callable and constructable CommonJS imports and modern ESM imports.
- Historical deep imports
dev-null/indexanddev-null/index.jsremain available when the package is installed through an npm alias.
Runtime target
Node.js 12 and newer. Development tooling may require a newer Node.js release and is not part of the runtime contract.