Registry / devops / grpc-pack

grpc-pack

JSON →
library0.2.3jsnpmunverified

gRPC Pack simplifies gRPC usage in Node.js by providing wrappers around @grpc/grpc-js for faster setup. Version 0.2.3 is the latest, with no recent updates indicating active maintenance. It offers createServer and createClient functions that auto-load proto files and generate handlers. Compared to direct gRPC usage, it reduces boilerplate but provides less flexibility. The package has low downloads and may have limited community support.

npm install grpc-pack
INSTALL
IMPORT
SIG · GRPC-PACK
G
grpc-pack
devopsjavascriptv0.2.3
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
const { createServer } = require('grpc-pack');
import { createServer } from 'grpc-pack';
Package uses CommonJS. ESM import may fail without a bundler or Node >=22 with --experimental-require-module.
createClient
const { createClient } = require('grpc-pack');
const createClient = require('grpc-pack').createClient;
Correct but unorthodox; destructuring is preferred.

Demonstrates creating a gRPC server and client using grpc-pack with a single proto file.

const { createServer, createClient } = require('grpc-pack'); // Server const server = createServer(); server.use({ protoPath: './protos', protoName: 'greeter.proto', serviceName: 'Greeter', routes: { hello: (call, callback) => { callback(null, { message: `Hello, ${call.request.name}` }); }, }, }); server.listen('0.0.0.0:6969'); // Client (separate process) const client = createClient( { protoPath: './protos', protoName: 'greeter.proto', serviceName: 'Greeter', }, '0.0.0.0:6969' ); client.hello({ name: 'User' }, (err, { message }) => { if (err) throw err; console.log(message); });
Debug
Known issues
gotchaprotoPath must point to a directory containing the .proto file, not the file itself.
fix
Set protoPath to the folder, not the file path.
affects: >=0.0.0
gotchaRoute handler names must match the exact gRPC method name (case-sensitive) as defined in the proto file.
fix
Use the exact method name from the proto file (e.g., 'hello' vs 'Hello').
affects: >=0.0.0
deprecatedThe package is unmaintained since 2021 and may not work with the latest @grpc/grpc-js versions.
fix
Consider using @grpc/grpc-js directly or migrate to a maintained gRPC wrapper.
affects: >=0.2.3
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open '...'
protoPath provided incorrectly; must be a directory path.
fix
Ensure protoPath points to the directory containing the .proto file, e.g., './protos'.
Error: Cannot read properties of undefined (reading 'hello')
Method name mismatch between routes and proto service definition.
fix
Check the exact method name in the proto file (e.g., 'Hello' vs 'hello').
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredCore gRPC library for Node.js
Agent activity
6 hits · last 30 days
node
6
Resources
grpc-pack — npm install grpc-pack · libregistry