Skip to main content

Module stream_web

Module stream_web 

Source
Expand description

Node stream/web module: the WHATWG Streams API.

The implementation is webstreams.js, a port of node v26.12.1’s lib/internal/webstreams/ (its files unchanged, behind a prelude that supplies the primordials and internals they import). It is evaluated once, on the first read of any stream class, and every class — the stream/web member and the global — is the port’s constructor, so streams are ordinary script objects: the spec’s promise-driven start/pull/ cancel, backpressure through highWaterMark/desiredSize, byte streams with BYOB readers and byobRequest, tee, and pipeTo/pipeThrough with signal/preventClose/preventAbort/preventCancel are node’s code.

This replaced a native reimplementation that ran pull synchronously (a pull that returned a promise was not awaited), had no byte streams, and drained pipeTo/tee eagerly.

Constants§

CLASSES
The members of require('stream/web'), in node’s order (lib/stream/web.js).
METHODS
stream/web exports no free functions that dispatch natively.

Functions§

constant
require('stream/web').<name> (and the global of the same name).
is_class
True if name is a member of require('stream/web').
is_global_class
True if name is one of the stream classes node also binds as a global — every member except ReadableStreamTee, which is a function.
is_readable_stream
node’s isReadableStream.
is_writable_stream
node’s isWritableStream.
readable_stream_cancel
node’s readableStreamCancel(stream, reason): cancel without the lock check ReadableStream.prototype.cancel makes.