A lightweight JavaScript library that enables gRPC-style remote procedure calls over WebSocket connections. Version 1.1.6 provides a simple API to load protocol buffer descriptors and invoke RPC methods through WebSocket. It is designed for real-time communication in browser and Node.js environments where gRPC over HTTP/2 is not suitable. The library wraps WebSocket with gRPC-like request/response patterns, handling serialization via Protocol Buffers. It is actively maintained with monthly releases and supports both CommonJS and ESM. Compared to full gRPC implementations, this package offers minimal overhead and easier setup for WebSocket-based RPC, though it lacks advanced features like streaming or authentication.
npm install websocket-grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a WebSocket gRPC connection and sends a request using the default export WsProto.
Ensure init() is awaited: await wsproto.init(...);
Implement custom reconnection logic or use a wrapper.
Use path.join(__dirname, './ws.proto') in Node.js
Use other libraries like @grpc/grpc-js for streaming.
Wrap init in try-catch and validate proto files externally.
Change to: const WsProto = require('websocket-grpc');Ensure await wsproto.init(...) resolves successfully before calling request.
Use absolute path or path.join(__dirname, './ws.proto')
No dependency data recorded yet.