/ c4f / front / node_modules / vscode-jsonrpc /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/8 months ago -  
[DIR]typings/8 months ago -  
[TXT]License.txt8 months ago1.1K 
[TXT]README.md8 months ago2.1K 
[TXT]browser.d.ts8 months ago385  
[   ]browser.js8 months ago411  
[   ]node.cmd8 months ago213  
[TXT]node.d.ts8 months ago382  
[   ]node.js8 months ago408  
[   ]package.json8 months ago1.6K 
[TXT]thirdpartynotices.txt8 months ago1.8K 
README.md

VSCode JSON RPC

NPM Version NPM Downloads Build Status

This npm module implements the base messaging protocol spoken between a VSCode language server and a VSCode language client.

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';

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.sendNotification(notification, 'Hello World');

The server side looks very symmetrical:

import * as rpc from 'vscode-jsonrpc';


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();

History

5.0.0

4.0.0

3.0.0:

License

MIT

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80