Registry / productivity / grpc-tsd

grpc-tsd

JSON →
library1.1.0jsnpmunverified

Deprecated TypeScript type definitions for gRPC (v1.1.0). This package provided unofficial .d.ts files for gRPC Node.js until official types were published in 2017. It is now obsolete; users should migrate to official @grpc/grpc-js types. No longer maintained.

npm install grpc-tsd
INSTALL
IMPORT
SIG · GRPC-TSD
G
grpc-tsd
productivityjavascriptv1.1.0
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'
import { grpc } from 'grpc'
Default import used with this def; official @grpc/grpc-js uses named exports.
Server
import grpc from 'grpc'; const server = new grpc.Server()
import { Server } from 'grpc'
Types are under grpc namespace, not as named exports.
ServiceDefinition
import grpc from 'grpc'; const type: grpc.ServiceDefinition = ...
import { ServiceDefinition } from 'grpc'
Namespace access in this definition.

Shows how to include type definitions and use basic grpc types (Server, ServerCredentials) in a TypeScript project.

// Add 'node_modules/grpc-tsd/src/grpc.d.ts' to tsconfig.json include // Then use grpc types: import grpc from 'grpc'; const server: grpc.Server = new grpc.Server(); const credentials: grpc.ServerCredentials = grpc.ServerCredentials.createInsecure(); server.bind('0.0.0.0:50051', credentials); server.start();
Debug
Known issues
deprecatedPackage is deprecated; official types exist in @grpc/grpc-js v1.0+
fix
Migrate to @grpc/grpc-js and use its built-in types: npm install @grpc/grpc-js
affects: >=1.1.0
breakingImport pattern differs from official types: default vs named exports
fix
Use import grpc from 'grpc' for this def; official types require import * as grpc from '@grpc/grpc-js' or similar.
affects: >=1.0.0
gotchaTypes may be incomplete or inaccurate; not officially supported
fix
Prefer official @grpc/grpc-js types or generate own from protobuf.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'grpc-tsd'
Missing installation or not added to tsconfig.json include
fix
Run 'npm install --save-dev grpc-tsd' and add 'node_modules/grpc-tsd/src/grpc.d.ts' to tsconfig.json 'include' array.
error TS2307: Cannot find module 'grpc'
Missing @types/grpc or grpc package itself
fix
Install grpc package: 'npm install grpc' and add types: 'npm install --save-dev @types/grpc' (but note grpc-tsd replaces @types/grpc).
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
grpc-tsd — npm install grpc-tsd · libregistry