package
A json rpc implementation over streams
npm install vscode-jsonrpcGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
222.5 kB
Includes dependencies.
Latest published Oct 22, 2026
latest
This npm module implements the base messaging protocol spoken between a VSCode language server and a VSCode language client.
The Node.js entry point requires Node.js 14.17.0 or newer. The runtime abstraction layer exposes
RAL().crypto.randomUUID() for cryptographically generated v4 UUIDs. The browser implementation
uses native crypto.randomUUID() when available and falls back to crypto.getRandomValues(),
including in non-secure contexts. Custom RAL implementations must provide this capability.
The npm module can also be used standalone to establish a JSON-RPC channel between a client and a server. Below an example how to setup a JSON-RPC connection. First the client side.
import * as cp from 'child_process';
import * as rpc from 'vscode-jsonrpc/node';
let childProcess = cp.spawn(...);
// Use stdin and stdout for communication:
let connection = rpc.createMessageConnection(
new rpc.StreamMessageReader(childProcess.stdout),
new rpc.StreamMessageWriter(childProcess.stdin));
let notification = new rpc.NotificationType<string, void>('testNotification');
connection.listen();
connection.sendNotificationThe server side looks very symmetrical:
import * as rpc from 'vscode-jsonrpc/node';
let connection = rpc.createMessageConnection(
new rpc.StreamMessageReader(process.stdin),
new rpc.StreamMessageWriter(process.stdout));
let notification = new rpc.NotificationType<string, void>('testNotification');
connection.onNotification(notification, (param: string) => {
console.log(param); // This prints Hello World
});
connection.listen();For the history please see the main repository
microsoft-oss-releases
microsoft-oss-publishing@microsoft.com