extra-native-websocket (v0.5.2) is a lightweight, TypeScript-first library that wraps native WebSocket with a promise-based API, typed error handling, reconnection strategies, and state management. It extends an emitter pattern from @blackglory/structures, offering autoReconnect and exponential backoff without external dependencies. Requires Node >=22 and ESM-only. Differentiates from ws or isomorphic-ws by focusing on native WebSocket and providing extra utilities like autoReconnect and WebSocketError.
npm install extra-native-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an ExtraNativeWebSocket with reconnection, connects, sends and receives a message.
Wrap WebSocket creation in a lambda.
Upgrade to 0.5.1+ or manually check AbortSignal in your own wrapper.
Use autoReconnect with manual exponential backoff logic instead.
Use Node 22+ or transpile with bundler.
Install @blackglory/structures: npm install @blackglory/structures
Use import or dynamic import() instead of require()
Upgrade Node to >=22 or use a bundler/transpiler