
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
protoc-gen-tsd
Advanced tools
Protocol Buffers Compiler(protoc) plugin for TypeScript - Generate definition file(d.ts)
Protoc Plugin for generating TypeScript definition
The library exports the protoc-gen-tsd executable, which generates a TypeScript definition file(.d.ts file).
npm install protoc-gen-tsd
export PATH=./node_modules/.bin:$PATH
# single .proto file
protoc --tsd_out=./examples/protos ./examples/protos/echo.proto
# multiple .proto file
protoc --tsd_out=./examples/protos -I=./examples/protos ./examples/protos/*.proto
Some time ago, gRPC released pure JavaScript implementation of client @grpc/grpc-js without a C++ addon.
The @grpc/grpc-js load package definition object(grpc.loadPackageDefinition) requires a @grpc/proto-loader to load the proto file.
@grpc/grpc-js serialization and deserialization protocol buffer messages depend on the @grpc/proto-loader output package definition object.
When we get the protocol buffer message, it has been deserialized and we can get the information directly from the property accessor.
So, to work with TypeScript you only need to declare the type protobuf message.
.d.ts file | protoc-gen-tsd | ts-protoc-gen |
|---|---|---|
| get/set field | :x: | :heavy_check_mark: |
google-protobuf dependency | :x: | :heavy_check_mark: |
grpc dependency | :x: | :heavy_check_mark: |
@grpc/grpc-js dependency | :heavy_check_mark: | :x: |
#!/usr/bin/env node --inspect-brk --require ts-node/register ./src/index.ts
export PATH=./bin:$PATH
protoc --tsd_out=. examples/protos/echo.proto
<% debugger; %>
FAQs
Protocol Buffers Compiler(protoc) plugin for TypeScript - Generate definition file(d.ts)
The npm package protoc-gen-tsd receives a total of 2 weekly downloads. As such, protoc-gen-tsd popularity was classified as not popular.
We found that protoc-gen-tsd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.