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/webexports no free functions that dispatch natively.
Functions§
- constant
require('stream/web').<name>(and the global of the same name).- is_
class - True if
nameis a member ofrequire('stream/web'). - is_
global_ class - True if
nameis one of the stream classes node also binds as a global — every member exceptReadableStreamTee, 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 checkReadableStream.prototype.cancelmakes.