A code generator for TypeScript based on Protobuf definitions, written in Rust.
- Generates well-formatted, easy to read and extendable TypeScript code
- Generated code only depends on
google-protobuf - Supports all field types
- Generates service stubs
- Generates enums
- Allows using
String,NumberorBigIntfor 64-bit integers - Enhanced integrations for
google.protobuf.Timestampandgoogle.protobuf.Durationwith JavaScriptDate - Support for packed and unpacked fields
- Generated code is fully tested using Jest
Install the application using Cargo:
cargo install --path .
This will place the protoc-gen-typescript binary by default in your ~/.cargo/bin folder.
If you have that folder inside your path, you should be able to find it using
which protoc-gen-typescript
Using Protoc you can now convert your Protobuf definitions into TypeScript:
mkdir -p gen
protoc --typescript_out=gen --proto_path=include include/*.proto