ws
A strong pick. 4th of 10 realtime and collaboration.
ws is the standard low-level WebSocket client and server for Node.js. It is fast, has no dependencies and is carefully maintained. It is a strong pick when you want raw WebSockets. It gives you only the transport, so rooms, reconnection and shared editing are left to you or to tools such as Socket.IO, Yjs or Hocuspocus.
Best for: Node.js developers who want a lean, standards-compliant WebSocket server or client and will build their own messaging layer on top.
Scores
Overall7.8
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
ws is the best choice when you need a plain WebSocket server or client in Node.js. It is mature, actively maintained and recommended by Node.js itself. It is not the default for the category's broader job: Socket.IO gives you rooms and reconnection, and Yjs or Hocuspocus handle collaborative editing. Those tools often use ws underneath.
- nodejs.org/en/learn/getting-started/websocket: Recommended server library
- pkgpulse.com/guides/socketio-vs-ws-vs-uwebsockets-websocket-servers-nodejs-2026: Suggests Socket.IO for chat and dashboards, and ws for raw needs
- peers: Socket.IO and Yjs cover more of the category's job
GPT-6.2 Sol: 8.0, likely 6.9 to 8.9
ws is a strong choice for a new Node.js service that needs standard WebSockets, with a documented API, competitive performance, and a record of shipping security fixes. Socket.IO is a better starting point for apps that need built-in reconnects and rooms, and Yjs is a better starting point for concurrent editing. The fit depends on how much connection and application state the team wants to own, and publishing still rests with one maintainer.
- github.com/websockets/ws/blob/8.23.0/README.md: Documents standard client compatibility and the low-level API.
- github.com/websockets/ws/releases: Shows current maintenance and security backports.
- socket.io/docs/v4: Documents built-in reconnection and broadcasting to rooms.
- docs.yjs.dev: Documents shared data types that merge concurrent edits.
- socket.dev/npm/package/ws/versions: Shows one listed npm maintainer.
Needed by many5.4
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Many Node.js web apps need a WebSocket server, and ws is the usual base for one. It covers only the transport part of the category, not collaborative editing. It runs on Node.js only and does not work in the browser.
- nodejs.org/en/learn/getting-started/websocket: Node has no built-in WebSocket server and recommends ws or socket.io
- github description: WebSocket client and server for Node.js
GPT-6.2 Sol: 4.7, likely 3.5 to 5.9
Chat, games, and live dashboards can use its two-way transport, and it works across Node.js frameworks. Its audience narrows to teams that need a WebSocket server or more control than Node.js's built-in client provides. The developer survey measures Node.js use, so demand for that narrower job remains an estimate.
- survey.stackoverflow.co/2026/technology/data/web-framework-timeseries: 46.4% of respondents to the web technology question reported using Node.js.
- github.com/websockets/ws/blob/8.23.0/README.md: Documents the Node.js transport and browser interoperability.
- nodejs.org/api/globals.html#websocket: Modern Node.js ships a stable WebSocket client.
Helps a lot7.9
How well does it do the job for those who need it?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
As a raw WebSocket implementation it is about as good as it gets in Node.js. It is correct, thoroughly tested, fast and well documented, and AI agents write code for it reliably. For the category's job it is a building block only: rooms, reconnection, auth helpers and sync have to be built on top. uWebSockets.js uses less memory at very high connection counts.
- pkgpulse.com/guides/socketio-vs-ws-vs-uwebsockets-websocket-servers-nodejs-2026: Lean and fast, but no rooms or reconnection, and an awkward verifyClient
- github.com/websockets/ws/releases: Steady refinements such as the protocols and maxPendingAutoPongs options
- npm hasTypes: No bundled types; @types/ws is needed
GPT-6.2 Sol: 8.2, likely 7.2 to 9.2
Version 8.23.0 has a small API, client and server conformance tests, and named errors that help developers and coding agents diagnose failures. The separate TypeScript declarations can lag runtime options, and teams own the behavior around dropped connections. An independent benchmark put ws 8.22.0 close to uWebSockets.js in throughput on Node.js, though it measured a simple two-client relay.
- github.com/websockets/ws/blob/8.23.0/README.md: Links client and server Autobahn reports and documents common patterns.
- github.com/websockets/ws/blob/8.23.0/doc/ws.md: Documents error codes, Node.js streams, and the new maxPendingAutoPongs option.
- github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ws/index.d.ts: Separate declarations had yet to include maxPendingAutoPongs.
- lemire.me/blog/2026/10/10/websocket-servers-in-javascript-node-js-bun-and-deno-in-2026: Measured 45,000 round trips per second with ws and 49,000 with uWebSockets.js on Node.js.
- reddit.com/r/react/comments/1ptzfkv/does_anyone_else_struggle_so_much_with_setting_up: Developers describe reconnection and deployment work when using raw WebSockets.
Holds up over time7.9
Will it still be a good choice in two years?
Claude Opus 5.5: 8.0, likely 6.5 to 9.0
The project is active, with 23 releases and 60 commits in the last year, only 6 open issues, and careful backports to old major lines. The 8.x API has been stable for years. Node.js has no built-in server, so ws remains the base layer. The main risk is that most releases are published by one maintainer.
- github releasesLastYear: 23 releases, the latest on 2026-11-12
- github openIssues: 6 open against 1561 closed
- github.com/websockets/ws/releases: Releases published by lpinca, with fixes backported to 5.x, 6.x and 7.x
- nodejs.org/en/learn/getting-started/websocket: Node ships a built-in client only, not a server
GPT-6.2 Sol: 7.7, likely 6.4 to 8.6
Sixty commits and 23 releases over the past year show active maintenance, with security fixes reaching older versions. A user reported that a tighter fragment limit disrupted legitimate traffic, and the maintainer answered the same day with a configuration option. Recent releases came from one npm maintainer, and public sponsorship leaves long-term staffing uncertain.
- github commitsLastYear, releasesLastYear, openIssues, openPullRequests: 60 commits, 23 releases, six open issues, and one open pull request.
- github.com/websockets/ws/releases: Recent v8 releases and same-day security backports to v5, v6, and v7.
- github.com/websockets/ws/issues/2335: A user reported broken database traffic after a security update and received a same-day reply.
- socket.dev/npm/package/ws/versions: Lists one npm maintainer and the same publisher across recent releases.
- github.com/sponsors/lpinca: The maintainer receives sponsorship for work across several projects.
Used widely8.4
How many use it, and is that growing?
Claude Opus 5.5: 9.0, likely 8.0 to 9.5
About 900,000 dependent repos and 19,000 dependent packages make it the most used package in the category, even though most downloads are transitive. Downloads grew 3.3x in a year, which is below the 4.1x median, so its share is slipping slightly. Direct choice is still very large.
- dependents repos: 900,116 repos and 19,475 packages
- npm downloadsLast4Weeks: 1.61B, up from 483M a year ago (ratio 3.3, median 4.1)
- pkgpulse.com/guides/socketio-vs-ws-vs-uwebsockets-websocket-servers-nodejs-2026: Downloads mostly transitive
GPT-6.2 Sol: 7.8, likely 6.5 to 8.8
The collector found about 900,000 dependent repositories, behind Socket.IO's 1.35 million and well ahead of the other measured peers. Socket.IO itself pulls in ws through Engine.IO, and repeated automated installs further inflate the 1.61 billion downloads. Downloads grew 3.32 times year over year, below the 4.1 times catalog median, so its relative share slipped by that measure. The count of projects actively choosing ws today remains uncertain.
- dependents repos, packages: 900,116 repositories and 19,475 npm packages in the collector's coverage.
- peers dependentRepos: Socket.IO has 1,351,985 dependent repositories in the same dataset.
- npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo, medianDownloadsRatio: 1.606 billion versus 483.3 million downloads, or 3.32 times growth against 4.1 times.
- github.com/socketio/socket.io/blob/main/packages/engine.io/CHANGELOG.md: Engine.IO explicitly tracks ws as a dependency.
Vouched for8.2
Who stands behind it being good?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
The official Node.js docs recommend it. It is part of Node's CITGM ecosystem testing. Major tools depend on it, including Next.js, VS Code and Puppeteer. Independent guides call it the standard Node.js WebSocket implementation. There is little survey data specific to ws.
- nodejs.org/en/learn/getting-started/websocket: Recommended by the Node.js docs
- pkgpulse.com/guides/best-websocket-libraries-nodejs-2026: Described as the de facto standard
- github.com/websockets/ws/releases: A release fixes a CITGM test
GPT-6.2 Sol: 8.3, likely 7.2 to 9.2
Socket.IO's Engine.IO transport and Fastify's WebSocket plugin depend on ws, and NestJS ships a dedicated adapter. Those integrations and a recent independent benchmark support its quality as a transport. The evidence is strongest for framework use and simple message exchange, with less visibility into application-level satisfaction and production workloads.
- github.com/socketio/socket.io/blob/main/packages/engine.io/CHANGELOG.md: Socket.IO's transport layer maintains a ws dependency.
- github.com/fastify/fastify-websocket/blob/main/package.json: Fastify's public WebSocket plugin declares ws as a runtime dependency.
- docs.nestjs.com/websockets/adapter: NestJS supports ws through its own WebSocket adapter.
- lemire.me/blog/2026/10/10/websocket-servers-in-javascript-node-js-bun-and-deno-in-2026: Independent October 2026 benchmark confirms competitive Node.js throughput.
Safe7.1
How safe is it to depend on?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It has zero dependencies and an MIT licence, and advisories are fixed quickly with backports. However, 2026 brought several remote memory-exhaustion DoS issues (CVE-2026-48779, a follow-up CVE-2026-62389, and the Pong flood fixed in 8.23.0) plus a memory disclosure. The Scorecard is 5.9, with no branch protection, fuzzing or SAST, and a single main publisher.
- advisories: 7 total, 2 in the last 24 months in the bundle
- osv.dev/GHSA-96hv-2xvq-fx4p: High DoS advisory, fixed in 8.21.0 with backports
- nvd.nist.gov/vuln/detail/CVE-2026-62389: Follow-up memory exhaustion fixed in 8.21.1
- scorecard score: 5.9 overall, with Branch-Protection, Fuzzing and SAST all at 0
- npm dependencies: 0 dependencies
GPT-6.2 Sol: 7.2, likely 6.0 to 8.2
The MIT license and zero required runtime dependencies limit supply-chain exposure. Version 8.23.0 fixes the known 2026 memory issues, including a high-severity November denial-of-service advisory missing from the bundle that received a fix and three backports on disclosure day. The 5.9 OpenSSF Scorecard flags weak review, branch protection, pinning, and fuzzing, and leaves packaging and release signing unscored. A single listed npm maintainer concentrates publishing access.
- npm dependencies, license: Zero required dependencies and a permissive MIT license.
- scorecard score, checks: 5.9 overall, review at 4, branch protection, pinning, and fuzzing at 0.
- github.com/websockets/ws/security/advisories/GHSA-37g9-w4hg-h9qr: November advisory lists fixes for v5, v6, v7, and v8.
- github.com/websockets/ws/security/advisories/GHSA-96hv-2xvq-fx4p: Earlier memory exhaustion issue was fixed in 8.21.0 and older branches.
- github.com/websockets/ws/security/advisories/GHSA-58qx-3vcg-4xpx: Memory disclosure was fixed in 8.20.1.
- socket.dev/npm/package/ws/versions: Recent releases trace to one listed npm maintainer.
Good
- It has zero runtime dependencies and a small, stable API that has not had a major breaking release since 8.0.
- The Node.js docs recommend it for WebSocket servers, and many tools build on it, including Next.js, VS Code, Puppeteer and Socket.IO's engine.
- Security fixes ship fast and are backported to the 5.x, 6.x and 7.x lines.
- It runs fast with modest memory use and supports permessage-deflate, binary frames and backpressure.
Bad
- It has no rooms, named events, automatic reconnection, fallbacks or scaling across servers. You have to build these yourself.
- Types come from the separate @types/ws package, not from ws itself.
- Releases depend mostly on one maintainer, and the OpenSSF Scorecard shows weak code review and branch protection.
- Several memory-exhaustion DoS advisories appeared in 2026, so servers need prompt upgrades.
The numbers
- npm downloads, 4 weeks
- 1.6B ×3.3 in a year
- GitHub stars
- 23k
- Commits, 12 months
- 60
- npm version
- 8.23.0 Nov 2026
- Versions, 12 months
- 23
- Advisories, 24 months
- 2 of 7 ever
- OpenSSF Scorecard
- 5.9 out of 10, Nov 2026
- Licence
- MIT
Many packages install it, so most downloads are not a direct choice.
Read on 21 November 2026 from GitHub (websockets/ws), npm (ws), OSV and the OpenSSF Scorecard.
Realtime and collaboration
- 8.2Yjs
- 7.9Socket.IO
- 7.8Hocuspocus
- 7.8ws
- 7.5Liveblocks
- 7.1Ably SDK
- 7.1Automerge
- 7.0Loro
- 6.6PartyServer
- 6.6Pusher SDK