Protobufts (version 0.3.1) is a TypeScript code generator that produces strongly-typed models from Protocol Buffer (.proto) definitions, specifically designed for use with Node.js gRPC. It generates TypeScript interfaces and classes for message types, enums, and services, enabling type-safe gRPC client and server implementations. Unlike generic protobuf JavaScript generators, protobufts outputs idiomatic TypeScript with full type information, reducing runtime errors and improving developer experience. The project is in early stages, with recent releases focused on core functionality and limited customization options.
npm install protobuftsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates TypeScript models from a .proto file and writes them to a .ts file.
Update calls to generateCode(protoContent, { noGrpc: false }).Replace { grpc: true } with { noGrpc: false } in options.npm install protobufjs as a dependency.
Convert proto2 files to proto3 or use other code generators.
Check the generated output and manually fill in any missing service code.
Install protobufjs: npm install protobufjs
Use named import: import { generateCode } from 'protobufts'Update your .proto file to use syntax = "proto3";
Ensure protobufjs is installed and imported in your project before using generated models.