Registry / messaging / eiows
library9.2.0jsnpmunverified

eiows is a high-performance WebSocket engine for Node.js, designed as a drop-in replacement for the ws module in Socket.IO applications. Version 9.2.0 provides significant performance and memory-usage improvements but is only compatible with Node.js (v16 to <27) and runs exclusively on Linux, FreeBSD, and macOS. It requires engine.io 3.4.2 or higher and the system must have Git installed for native compilation. Compared to ws, eiows offers better scalability for WebSocket-heavy applications while maintaining API compatibility.

npm install eiows
INSTALL
IMPORT
SIG · EIOWS
E
eiows
messagingjavascriptv9.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eiows
import eiows from 'eiows'
const eiows = require('eiows')
Default import works in ESM; CommonJS requires require('eiows') but it's the default export.
Server
import { Server } from 'eiows'
const { Server } = require('eiows')
Named export 'Server' is available in both ESM and CJS.
eiows.Server
new Server({ port: 8080 })
new eiows.Server({ port: 8080 })
When using default import, eiows.Server is the class. Alternatively import { Server } directly.

Create a Socket.IO server with eiows as the WebSocket engine, listening on port 3000.

import * as http from 'http'; import { Server } from "socket.io"; import eiows from 'eiows'; let server = http.createServer(); let io = new Server(server, { wsEngine: eiows.Server, perMessageDeflate: { threshold: 32768 } }); io.on("connection", (socket) => { console.log('Client connected'); }); server.listen(3000);
Debug
Known issues
gotchaeiows only works on Linux, FreeBSD, and macOS. Windows is not supported.
fix
Use a different platform or consider using ws module on Windows.
affects: >=1.0.0
gotchaGit must be installed on the system to build and compile the native module.
fix
Install Git and ensure it's in PATH before npm install.
affects: >=1.0.0
breakingEngines requirement: Node.js >=16 and <27.0. Older Node versions are not supported.
fix
Upgrade Node.js to 16 or later (up to 26).
affects: >=9.0.0
gotchaperMessageDeflate threshold is required (recommended 32768) to avoid memory issues.
fix
Always set perMessageDeflate.threshold when using eiows with Socket.IO.
affects: >=1.0.0
gotchaUsing eiows.Server directly without Socket.IO is not documented; expected usage is via wsEngine option.
fix
Use eiows.Server as a wsEngine in Socket.IO, not as a standalone server.
affects: >=1.0.0
deprecatedCommonJS require('eiows') may not work if the package is used in a pure ESM environment.
fix
Use ESM import statement or dynamic import() in ESM context.
affects: >=9.0.0
Errors
Common errors & fixes
Error: The module 'eiows' was compiled against a different Node.js version
Native addon compiled for a different Node version than the one running.
fix
Reinstall the package: npm rebuild eiows or remove node_modules and npm install.
Error: Cannot find module 'eiows'
Package not installed or not found in node_modules.
fix
Run npm install eiows in the project root.
Error: Module did not self-register.
Native binary mismatch due to Node.js version change.
fix
Delete node_modules and package-lock.json, then reinstall.
eiows requires engine.io version >= 3.4.2
Incompatible engine.io version installed.
fix
Upgrade engine.io: npm install engine.io@>=3.4.2
Upgrade
Version history
9.2.0latest on npm
Audit
Dependencies
engine.iorequiredRequired to use eiows with Socket.IO; eiows acts as a ws replacement for engine.io.
Agent activity
23 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
packageeiows
eiows — npm install eiows · libregistry