Tiny WebSocket wrapper (~635 bytes brotlied) with auto-reconnect (exponential backoff) and message buffering. Version 2.3.2, stable. Smaller than alternatives like reconnecting-websocket. Ships TypeScript types. Features: on() returns unsubscribe, message callback receives data directly (not event), connect() returns Promise.
npm install wsclNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket client with auto-reconnect, sends a message before connection, then connects and logs events.
Change import from 'import Client from "wscl"' to 'import { Client } from "wscl"'.Pass url in constructor options.
Handle connection errors or use a timeout to detect failure.
Move URL to constructor options.
Ensure you have created a Client instance: const client = new Client({ url: '...' }); await client.connect();Install via 'npm install wscl' and use 'import { Client } from 'wscl''.Install 'ws' package and set global.WebSocket = require('ws') before importing wscl, or use a bundler.Use 'import { events } from 'wscl'' and then access events.Open.No dependency data recorded yet.