Registry / devops / grpc-js-kit

grpc-js-kit

JSON →
library0.1.1jsnpmunverified

A lightweight wrapper around @grpc/grpc-js and @grpc/proto-loader that simplifies setting up gRPC servers and clients on Node.js. Version 0.1.1 is the latest stable release, published as a fork that replaces the native grpc dependency with the pure JavaScript @grpc/grpc-js. It provides a unified API for creating servers and clients, supports unary and streaming RPCs, and allows both callback and async route handlers. Its key differentiator is the reduced boilerplate—no manual proto loading or service registration is required. Release cadence is low; the package is not actively maintained (last update 2020).

npm install grpc-js-kit
INSTALL
IMPORT
SIG · GRPC-JS-KIT
G
grpc-js-kit
devopsjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createServer
import { createServer } from 'grpc-js-kit'
const createServer = require('grpc-js-kit').createServer
ESM and CJS both work; CJS via require is common.
createClient
import { createClient } from 'grpc-js-kit'
const grpcKit = require('grpc-js-kit'); const client = grpcKit.createClient(...)
Direct named import is preferred.
default
import grpcKit from 'grpc-js-kit'
const grpcKit = require('grpc-js-kit').default
No default export; only named exports exist.

Sets up a gRPC server with a unary route and a client that calls it, using CJS require.

const { createServer } = require('grpc-js-kit'); const server = createServer(); server.use({ protoPath: '/path/to/greeter.proto', packageName: 'greeter', serviceName: 'Greeter', routes: { hello: (call, callback) => { callback(null, { message: `Hello, ${call.request.name}` }); } } }); server.listen('0.0.0.0:50051'); const { createClient } = require('grpc-js-kit'); const client = createClient({ protoPath: '/path/to/greeter.proto', packageName: 'greeter', serviceName: 'Greeter' }, '0.0.0.0:50051'); client.hello({ name: 'World' }, (err, res) => { if (err) throw err; console.log(res.message); });
Debug
Known issues
deprecatedPackage is not actively maintained; last update in 2020.
fix
Evaluate alternative libraries or fork for continued support.
affects: >=0.1.1
gotchaRequires @grpc/grpc-js as a peer dependency; installing only grpc-js-kit will cause runtime errors.
fix
Run npm install @grpc/grpc-js @grpc/proto-loader grpc-js-kit
affects: >=0.1.0
gotchaProto path resolution: relative paths are relative to process.cwd(), not the module location.
fix
Use absolute paths or resolve relative to __dirname.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '@grpc/grpc-js'
Missing peer dependency.
fix
npm install @grpc/grpc-js
TypeError: createClient is not a function
Using default import instead of named import.
fix
Use const { createClient } = require('grpc-js-kit');
Error: ENOENT: no such file or directory, open '...'
Proto file path is incorrect.
fix
Provide absolute path or correct relative path from CWD.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredPeer dependency; core gRPC implementation.
@grpc/proto-loaderrequiredPeer dependency; loads .proto files.
Agent activity
6 hits · last 30 days
node
6
Resources
grpc-js-kit — npm install grpc-js-kit · libregistry