WHATWG Streams Implementation
This repository provides a stand-alone implementation in Node.js of the WHATWG Streams Living Standard Specification
Current Status
Current status is WIP (Work In Progress) and implements the Standard as follows:
- Readable streams - partial (missing support for byte streams)
- ReadableStream - partial
- ReadableStreamDefaultReader - complete
- ReadableStreamBYOBReader - missing (WIP)
- ReadableStreamDefaultController - complete
- ReadableByteStreamController - missing (WIP)
- ReadableStreamBYOBRequest - missing
- Writable streams - missing
- WritableStream - missing
- WritableStreamDefaultWriter - missing
- WritableStreamDefaultController - missing
- Transform streams - missing
- TransformStream - missing
- TransformStreamDefaultController - missing
- Other API and operations - partial
- Queuing strategies - missing
- ByteLengthQueuingStrategy - missing
- CountQueuingStrategy - missing
- Queue-with-sizes - complete
- Miscellaneous operations - almost complete
- TransferArrayBuffer(O) - missing
- Queuing strategies - missing
Usage example (ReadableStream)
const nodeReadableStream = ; // Get a Node.js Readable stream somehow // Create a ReadableStream instance, based on the nodeReadableStream underlying source.const stream = { nodeReadableStream; nodeReadableStream; nodeReadableStream; nodeReadableStream; } { nodeReadableStream; } { nodeReadableStream; }; // Get a Reader for the stream.const reader = stream; // Start reading from the reader.; // Function that reads from the reader, consuming all data. { let value; let done = false; while !done value done = await reader; // Do something with value, if `done` is still not `true` // Finished reading. Do something}