
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.
It is the cli for pbts. You can convert protobuf to typescript file by command line
step 1 Install pbts
npm i pbts -g
step 2 Convert your protobuf to Typescript Definition File
pbts -i input/app/order.proto -o output/order.ts
Description
convert based on local protobuf
Usage
$ pbts [options]
Options
-i, --input input file path
-o, --output output file path
-outputType, --<outputType> output file type, including typescript,definition,jsdoc, default typescript
-mode, --<mode> edge case for int64(long type), including normal,strict, default strict
-v, --version Displays current version
-h, --help Displays this message
Examples
$ pbts -i test.proto -o test.ts
Please use npx for short.
npx pbts -i packages/cli/__tests__/__fixtures__/input/app/single.proto -o packages/cli/__tests__/__fixtures__/output/single.ts
import { parseProto } from 'pbts/core';
const source = `
syntax = "proto3";
message MyRequest {
string path = 1;
}
`;
const ts = parseProto(source, {
// Options
outputType,
mode,
});
| parameter | type | description |
|---|---|---|
| outputType | string | output file type, including typescript,definition,jsdoc, default typescript |
| mode | string | edge case for int64(long type), including normal,strict, default strict |
The result is as follow.
interface MyRequest {
path: string;
}
More file operation is supported.
import { parseProto } from 'pbts';
const source = `
syntax = "proto3";
message MyRequest {
string path = 1;
}
`;
const ts = parseProto(source);
FAQs
protobuf-to-typescript
We found that pbts 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.