node
v22.0.0

Node.js 22: Native WebSocket Client

Node.js 22 introduces a native WebSocket client, eliminating the need for external dependencies.

January 23, 20253 min

Node.js 22: Native WebSocket Client

Node.js 22 continues the trend of adding built-in features that previously required external packages.

Native WebSocket

No more installing ws or socket.io for basic WebSocket operations:

javascript
const ws = new WebSocket('wss://example.com');

ws.onmessage = (event) => {

console.log(event.data); };

ws.send('Hello, Server!');

Test Runner Improvements

The built-in test runner now supports more features like snapshots and better mocking.

#

Performance

  • V8 12.4 engine
  • Faster startup
  • Better memory management

    Node.js remains the backbone of server-side JavaScript.

  • Key Highlights

    • New features for developers
    • Performance improvements
    • Recommended for migration
    Note
    Before upgrading, we recommend reviewing the breaking changes in the official documentation.

    Automate your release announcements

    Shiplit turns GitHub releases into posts for Twitter, LinkedIn and Threads in seconds.