Isomorphic WebSocket implementation that works consistently across Node.js, Bun, Deno, and modern browsers. Version 1.0.7 provides a drop-in replacement for the native WebSocket API, using the 'ws' package on Node.js and the native implementation elsewhere. It is actively maintained by the wevm team (known for viem and wagmi). Unlike raw 'ws', isows provides a universal interface without bundler plugins. It is ESM-only and ships TypeScript definitions. Release cadence is infrequent, focused on stability.
npm install isowsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket connection to an echo server, sends a message, and logs the response.
Use dynamic import() or set type: module in package.json if using Node.js with require.
Always import WebSocket from 'isows' rather than relying on global.
Install 'ws' alongside isows: npm install isows ws
Test thoroughly on target platforms; consider polyfilling with 'react-native-websocket' if needed.
Run npm install isows ws
Use import { WebSocket } from 'isows' instead of import WebSocket from 'isows'Convert to ESM (type: module) or use dynamic import: const { WebSocket } = await import('isows')Run npm install ws