{"library":"express-ws","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"5.0.2","tags":["javascript","express","ws","websocket"],"last_verified":"Sun Jun 07","install":[{"cmd":"npm install express-ws","imports":["const expressWs = require('express-ws')(app);","const expressWs = require('express-ws')(app); expressWs.applyTo(router);","const expressWs = require('express-ws')(app); const wss = expressWs.getWss();"]},{"cmd":"yarn add express-ws","imports":[]},{"cmd":"pnpm add express-ws","imports":[]}],"homepage":"https://github.com/HenningM/express-ws","github":"https://github.com/HenningM/express-ws","docs":null,"changelog":null,"pypi":null,"npm":"express-ws","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}