Version 3.3.2 (latest). Provides a pull-stream interface for WebSocket client and server connections. Supports both Node.js and browser environments (via ws package on Node). Key differentiators: uses pull-streams (not Node streams), offers simple connect/server APIs, and integrates well with multiplexing libraries like muxrpc. Stable but marked as unstable by author; maintained with occasional updates.
npm install pull-wsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows connecting to a WebSocket echo server, sending two messages, and collecting responses via pull-stream.
Explicitly set binary: true or false in connect options to ensure consistent behavior.
Always provide a callback to connect() to catch connection errors.
Pin to a specific version or monitor for breaking changes.
Use require('pull-ws/client') or configure bundler to handle CJS default exports.Ensure server is running and URL is correct. Use onConnect callback to handle errors.
Set binary option consistently between client and server, and ensure data types match.