{"id":26113,"library":"proto_ts_schema","title":"proto_ts_schema","description":"A CLI tool and library to compile/transpile Protocol Buffer .proto files into TypeScript interfaces and schemas. Current stable version is 1.0.1. Provides a configurable build system with CLI via `p2ti`. Key differentiators include support for relative imports, config file (JS/TS), and a declarative approach. However, it is early-stage with known caveats like message ordering dependency. Not as mature as alternatives like protobuf-ts or ts-proto. Ships TypeScript definitions.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/iambpn/proto_to_ts_schema","tags":["javascript","proto","protobuf","typescript","interface","proto-to-interface","proto-to-ts-interface","nest-proto-interface","typescript-interface"],"install":[{"cmd":"npm install proto_ts_schema","lang":"bash","label":"npm"},{"cmd":"yarn add proto_ts_schema","lang":"bash","label":"yarn"},{"cmd":"pnpm add proto_ts_schema","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is primarily a CLI tool; no programmatic Node.js API is exported.","wrong":"Trying to import as a module from code (there is no programmatic API documented).","symbol":"p2ti (CLI)","correct":"Installed globally and run via `p2ti` command. Usage: `p2ti --proto_files file.proto --out ./output`"}],"quickstart":{"code":"npm install -g proto_ts_schema\n# Create a config file (p2t.js) in current directory\nmodule.exports = {\n  // optional config\n};\n# Run the CLI with default options\np2ti -p ./protos -o ./out -f message.proto","lang":"typescript","description":"Installs the package globally, creates a minimal config file, and runs the CLI to transpile a proto file to TypeScript."},"warnings":[{"fix":"Reorder proto definitions so that referenced messages appear earlier in the file.","message":"Message ordering in .proto files matters: a message must be defined before it is used or it will cause an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure a config file exists at the working directory or pass --config explicitly.","message":"The package expects a config file at CWD/p2t.js by default; if missing, it may silently use defaults or error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the CLI via shell or child_process.exec to invoke transpilation.","message":"No programmatic API is documented; only CLI usage is supported.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Reorder messages in the .proto file so that all referenced messages are defined before their first use.","cause":"The .proto file references a message before it is defined (ordering issue).","error":"Error: Proto doesn't have the message named"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}