Registry / messaging / ut-wss

ut-wss

JSON →
library1.0.4jsnpmunverified

UT-WSS is a lightweight WebSocket server built on the WS library, providing a minimal wrapper for creating WebSocket connections in Node.js. The current stable version is 1.0.4, released on an irregular cadence as part of the UT ecosystem. It differentiates from raw 'ws' by offering utility functions and integration with the UT framework, but it is not actively maintained beyond minor patches.

npm install ut-wss
INSTALL
IMPORT
SIG · UT-WSS
U
ut-wss
messagingjavascriptv1.0.4
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.

default
import WebSocketServer from 'ut-wss';
const WebSocketServer = require('ut-wss');
Package is ESM-only; CommonJS require will fail.
WebSocketServer
import WebSocketServer from 'ut-wss';
import { WebSocketServer } from 'ut-wss';
Default export, not named export.
createServer
import createServer from 'ut-wss';
const createServer = require('ut-wss').createServer;
No named export 'createServer'; use default import.

Creates a WebSocket server on port 8080, logs connections and echoes messages back.

import WebSocketServer from 'ut-wss'; const server = new WebSocketServer({ port: 8080 }); server.on('connection', (ws, req) => { console.log('Client connected'); ws.on('message', (data) => { console.log('Received:', data.toString()); ws.send('Hello from server'); }); }); console.log('WebSocket server running on port 8080');
Debug
Known issues
breakingBreaking change: Ut-wss 1.0+ requires Node.js >= 12 and the 'ws' version must be >= 7.0.0.
fix
Update Node.js to >=12 and ensure 'ws' version in package.json is at least 7.0.0.
affects: >=1.0.0
gotchaThe package does not export TypeScript types; users must install @types/ws separately.
fix
Install @types/ws as a devDependency.
affects: >=0.0.0
deprecatedThe 'server' option in constructor is deprecated in favor of 'noServer' and manual upgrade.
fix
Use the 'noServer' option instead.
affects: >=1.0.0
gotchaEvent listener for 'message' receives data as Buffer; must call .toString() to get string.
fix
Convert to string with data.toString() or set 'binaryType' to 'blob' on client side.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ut-wss'
Package not installed or Node version < 12 (ESM not supported).
fix
Run 'npm install ut-wss' and ensure Node >= 12, or use CommonJS with dynamic import().
TypeError: WebSocketServer is not a constructor
Using named import instead of default import (e.g., import { WebSocketServer } from 'ut-wss').
fix
Use default import: import WebSocketServer from 'ut-wss';
Error: Module "ws" does not provide an export named 'WebSocketServer'
Incorrectly importing from 'ws' directly instead of using ut-wss wrapper.
fix
Use 'ut-wss' package instead of raw 'ws' import.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
wsrequiredCore WebSocket implementation, ut-wss wraps the ws library.
Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
packageut-wss
ut-wss — npm install ut-wss · libregistry