Installations
npm install ty-vscode-ws-jsonrpc
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.9.0
NPM Version
6.14.8
Score
72.6
Supply Chain
84.8
Quality
75.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
557
Last Day
1
Last Week
1
Last Month
19
Last Year
102
GitHub Statistics
MIT License
55 Stars
36 Commits
30 Forks
9 Watchers
2 Branches
7 Contributors
Updated on Sep 09, 2024
Bundle Size
32.36 kB
Minified
8.54 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.4.0
Package Id
ty-vscode-ws-jsonrpc@0.4.0
Unpacked Size
45.97 kB
Size
10.14 kB
File Count
53
NPM Version
6.14.8
Node Version
14.9.0
Total Downloads
Cumulative downloads
Total Downloads
557
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
137.5%
19
Compared to previous month
Last Year
-19.7%
102
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
3
VSCode WebSocket JSON RPC
NPM module to implement communication between a jsonrpc client and server over WebSocket.
Client side connection handling
1import * as rpc from 'vscode-ws-jsonrpc'; 2 3const webSocket = new WebSocket('ws://www.example.com/socketserver'); 4rpc.listen({ 5 webSocket, 6 onConnection: (connection: rpc.MessageConnection) => { 7 const notification = new rpc.NotificationType<string, void>('testNotification'); 8 connection.listen(); 9 connection.sendNotification(notification, 'Hello World'); 10 } 11});
Server side connection handling
1import * as rpc from 'vscode-ws-jsonrpc'; 2 3const socket: rpc.IWebSocket; // open the web socket 4const reader = new rpc.WebSocketMessageReader(socket); 5const writer = new rpc.WebSocketMessageWriter(socket); 6const logger = new rpc.ConsoleLogger(); 7const connection = rpc.createMessageConnection(reader, writer, logger); 8const notification = new rpc.NotificationType<string, void>('testNotification'); 9connection.onNotification(notification, (param: string) => { 10 console.log(param); // This prints Hello World 11}); 12 13connection.listen();
Server side connection forwarding
1import * as rpc from 'vscode-ws-jsonrpc'; 2import * as server from 'vscode-ws-jsonrpc/lib/server'; 3 4const socket: rpc.IWebSocket; // open the web socket 5const reader = new rpc.WebSocketMessageReader(socket); 6const writer = new rpc.WebSocketMessageWriter(socket); 7const socketConnection = server.createConnection(reader, writer, () => socket.dispose()) 8const serverConnection = server.createServerProcess('Example', 'node', ['example.js']); 9server.forward(socketConnection, serverConnection, message => { 10 if (rpc.isNotificationMessage(message)) { 11 if (message.method === 'testNotification') { 12 // handle the test notification 13 } 14 } 15 return message; 16});
License

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: License.txt:0
- Info: FSF or OSI recognized license: MIT License: License.txt:0
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
Reason
Found 5/23 approved changesets -- score normalized to 2
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Score
3.6
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More