Library for implementing communication between JSON-RPC client and server over WebSocket, part of the monaco-languageclient monorepo (TypeFox). Current stable version is 3.5.0. Released as part of monaco-languageclient, see its CHANGELOG for details. Key differentiators: tight integration with VSCode's JSON-RPC protocol, server-side forwarding, and usage in language server protocol (LSP) over WebSocket. Peer dependency on 'vscode-jsonrpc' for type definitions. Used by Monaco Editor and Theia for LSP over WebSocket.
npm install vscode-ws-jsonrpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket connection, registers a notification handler, and sends a notification.
Upgrade Node.js to >=20.10.0.
Use ES modules (import) in your project. If you must use CommonJS, consider dynamic import or downgrade to 2.x.
Import from the main entry: import { createServerProcess, forward } from 'vscode-ws-jsonrpc';When using 'listen', pass an object with a 'webSocket' key: { webSocket: myWebSocket, onConnection: ... }.Install the package: npm install vscode-ws-jsonrpc. Ensure tsconfig.json includes 'node_modules' in typeRoots or use 'skipLibCheck': true.
Switch to ES modules by setting "type": "module" in package.json and using import statements, or downgrade to v2.x.
Ensure you call connection.listen() before sending any messages.