Node.js native stream wrapper for WebSocket connections, version 1.0.0. Enables standard Node.js stream APIs (pipe, read, write) over WebSocket transport. Minimal footprint with no external dependencies. Differentiates by offering a simple, low-level stream interface directly on WebSocket instances, unlike higher-level libraries such as ws or socket.io.
npm install yws-streamNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a WebSocketStream from a WebSocket instance and using it with Node.js stream methods (on data, write, pipe).
Use 'const stream = new WebSocketStream(ws)' correctly.
Ensure WebSocket is open before creating the stream.
Use 'stream.write('data')' and check return value; consider using a transform stream for flow control.Call 'ws.close()' after stream ends or errors.
Replace 'import { WebSocketStream }' with 'import WebSocketStream'.Check stream.writableEnded before writing, or listen for 'finish' event.
Ensure the argument to WebSocketStream is a WebSocket instance with readyState === WebSocket.OPEN.
No dependency data recorded yet.