Registry / grpc-uds

grpc-uds

JSON →
library0.1.6jsnpmunverified

Experimental and temporary fork of the official @grpc/grpc-js library (v0.1.6) adding support for Unix Domain Sockets (UDS) on Node.js >=4.0. This package was created before UDS was natively supported in the main gRPC library. It provides both client and server gRPC implementations over UDS. Not actively maintained — users should migrate to the official @grpc/grpc-js package (v1.0+) which natively supports UDS. The package ships TypeScript types but has a very small install base and is no longer updated.

npm install grpc-uds
INSTALL
IMPORT
SIG · GRPC-UDS
G
grpc-uds
javascriptv0.1.6
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.

grpc
import grpc from 'grpc-uds'
const grpc = require('grpc-uds')
ESM import works if the target supports it; CommonJS require() is also valid but discouraged for modern Node.
loadPackageDefinition
import { loadPackageDefinition } from 'grpc-uds'
import loadPackageDefinition from 'grpc-uds'
loadPackageDefinition is a named export, not default.
Server
import { Server } from 'grpc-uds'
import Server from 'grpc-uds'
Server is a named export, not default.

Creates a gRPC server listening on a Unix Domain Socket using the grpc-uds package.

import grpc, { Server, loadPackageDefinition } from 'grpc-uds'; import path from 'path'; import { loadSync } from '@grpc/proto-loader'; const PROTO_PATH = path.resolve('helloworld.proto'); const packageDefinition = loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true }); const helloProto = loadPackageDefinition(packageDefinition).helloworld; function sayHello(call, callback) { callback(null, { message: 'Hello ' + call.request.name }); } const server = new Server(); server.addService(helloProto.Greeter.service, { sayHello: sayHello }); const socketPath = process.env.UDS_PATH || '/tmp/grpc-uds.sock'; server.bind('unix:' + socketPath, grpc.ServerCredentials.createInsecure()); server.start(); console.log('Server listening on', socketPath);
Debug
Known issues
deprecatedThis package is deprecated and no longer maintained. Use @grpc/grpc-js (v1.0+) which natively supports Unix Domain Sockets.
fix
Replace `grpc-uds` with `@grpc/grpc-js` and change imports accordingly.
affects: >=0.1.0
breakinggrpc-uds v0.1.6 exports everything as named exports; default import of grpc has limited functionality.
fix
Use named imports like `import { Server } from 'grpc-uds'` instead of relying on the default export.
affects: >=0.1.0
gotchaThe package requires Node >=4 but many features (e.g., UDS path parsing) may behave differently on older Node versions.
fix
Upgrade to Node >=10 for best compatibility.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'grpc-uds'
The package is not installed or is mistyped.
fix
Ensure `grpc-uds` is installed: `npm install grpc-uds` (or add to package.json).
TypeError: Cannot read properties of undefined (reading 'Greeter')
Proto file not loaded correctly or service definition is missing.
fix
Verify your .proto file path and that you have called `loadSync` before accessing the service.
Error: ENOENT: no such file or directory, unlink '/tmp/grpc-uds.sock'
The socket file path doesn't exist or the server didn't have permission to create it.
fix
Ensure the parent directory exists and your process has write permissions. Set `UDS_PATH` to a writable location.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredThis package is a fork/extended version of the official gRPC library
Agent activity
12 hits · last 30 days
node
12
Resources
grpc-uds — npm install grpc-uds · libregistry