express-ws

JSON →
library 5.0.2 ·javascript
verified Jun 7, 2026

Adds WebSocket endpoints to Express applications using the ws library. Version 5.0.2 (latest stable) is maintained with updates as needed. Express-ws enables defining WebSocket routes with standard Express middleware support, working seamlessly with Express routers. It modifies the global Router prototype by default and supports custom server instances and WebSocket options. The package requires Express peer dependency (express ^4.0.0 || ^5.0.0-alpha.1) and Node >=4.5.0. Key differentiator: minimal syntax compared to raw ws usage, but suffers from prototype monkey-patching and thread-unsafe design.