Registry / devops / uwestjs

uwestjs

JSON →
library2.0.1jsnpmunverified

uWestJS v2.0.1 is a high-performance platform adapter for NestJS powered by uWebSockets.js, providing HTTP and WebSocket capabilities with up to 4-5x faster performance than Express and 2-2.5x faster than Fastify. It maintains full compatibility with NestJS decorators and patterns, supports native backpressure handling, built-in compression, and streaming. Notable for its low memory footprint and ability to handle thousands of concurrent connections. Built specifically for Node.js >=24, it ships with full TypeScript types and supports NestJS v9-11. Its key differentiator is bringing uWebSockets.js performance to NestJS without requiring code changes.

npm install uwestjs
INSTALL
IMPORT
SIG · UWESTJS
U
uwestjs
devopsjavascriptv2.0.1
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.

UwsAdapter
import { UwsAdapter } from '@nestjs/platform-uws'
const { UwsAdapter } = require('uwestjs')
Default import path is '@nestjs/platform-uws' not 'uwestjs'. ESM-only since v2.
UwsSocket
import { UwsSocket } from '@nestjs/platform-uws/websocket'
import { UwsSocket } from 'uwestjs'
Socket type is exported from the websocket subpath. Not available from main entry.
UwsRequest
import { UwsRequest } from '@nestjs/platform-uws/http'
import { Request } from 'uwestjs'
HTTP request type is under '/http' subpath. Avoid name collision with Express types.
UwsResponse
import { UwsResponse } from '@nestjs/platform-uws/http'
Response type available in '/http' subpath for type safety.

Shows basic setup of a NestJS application using the uWestJS adapter (UwsAdapter) to replace Express/Fastify. Requires @nestjs/platform-uws package.

import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { UwsAdapter } from '@nestjs/platform-uws'; async function bootstrap() { const app = await NestFactory.create(AppModule, new UwsAdapter()); await app.listen(3000); console.log('uWestJS server running on http://localhost:3000'); } bootstrap();
Debug
Known issues
breakingv2.x requires Node.js >=24.0.0 (minimum version increased from v18)
fix
Upgrade Node.js to version 24 or higher (maximum 25). Check engines field in package.json.
affects: >=2.0.0
breakingImport paths changed in v2: The main entry point moved from 'uwestjs' to '@nestjs/platform-uws'
fix
Replace all imports from 'uwestjs' with '@nestjs/platform-uws' and subpath imports (e.g., '/http', '/websocket')
affects: >=2.0.0
deprecatedv1.x 'UwsAdapter' was exported as default; v2.x requires named import
fix
Change `import UwsAdapter from 'uwestjs'` to `import { UwsAdapter } from '@nestjs/platform-uws'`
affects: <2.0.0
gotchaBody size limit defaults to 100KB; larger payloads will be rejected silently
fix
Configure body parser options with `UwsAdapter({ bodyParser: { limit: '1mb' } })`
affects: >=2.0.0
gotchaWebSocket rooms are limited to 64KB of data per message; exceeding this may crash the server
fix
Implement message splitting or use streaming for large payloads; monitor with uws memory limits
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module '@nestjs/platform-uws'
Forgot to install the package or used wrong import path
fix
Run `npm install @nestjs/platform-uws` and ensure import paths are correct (not 'uwestjs')
TypeError: UwsAdapter is not a constructor
Using default import but uwestjs v2+ only exports named exports
fix
Change import to `import { UwsAdapter } from '@nestjs/platform-uws'`
Nest cannot find module 'reflect-metadata'
Missing peer dependency reflect-metadata
fix
Run `npm install reflect-metadata` and import it first in main.ts: `import 'reflect-metadata'`
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported for imports
uwestjs v2+ is ESM-only but project is configured as CommonJS
fix
Add `"type": "module"` to package.json or rename files to .mjs
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
@nestjs/commonrequiredPeer dependency required for NestJS decorators and base classes
@nestjs/websocketsoptionalPeer dependency required for WebSocket gateway support
reflect-metadatarequiredPeer dependency required for NestJS metadata reflection
rxjsrequiredPeer dependency required for reactive programming patterns in NestJS
Agent activity
4 hits · last 30 days
node
4
Resources
uwestjs — npm install uwestjs · libregistry