Registry / serialization / proto_ts_schema

proto_ts_schema

JSON →
library1.0.1jsnpmunverified

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.

npm install proto_ts_schema
INSTALL
IMPORT
SIG · PROTO_TS_SCHEMA
P
proto_ts_schema
serializationjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

p2ti (CLI)
Installed globally and run via `p2ti` command. Usage: `p2ti --proto_files file.proto --out ./output`
Trying to import as a module from code (there is no programmatic API documented).
The package is primarily a CLI tool; no programmatic Node.js API is exported.

Installs the package globally, creates a minimal config file, and runs the CLI to transpile a proto file to TypeScript.

npm install -g proto_ts_schema # Create a config file (p2t.js) in current directory module.exports = { // optional config }; # Run the CLI with default options p2ti -p ./protos -o ./out -f message.proto
p2ti --version
Debug
Known issues
gotchaMessage ordering in .proto files matters: a message must be defined before it is used or it will cause an error.
fix
Reorder proto definitions so that referenced messages appear earlier in the file.
affects: >=1.0.0
gotchaThe package expects a config file at CWD/p2t.js by default; if missing, it may silently use defaults or error.
fix
Ensure a config file exists at the working directory or pass --config explicitly.
affects: >=1.0.0
gotchaNo programmatic API is documented; only CLI usage is supported.
fix
Use the CLI via shell or child_process.exec to invoke transpilation.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Proto doesn't have the message named
The .proto file references a message before it is defined (ordering issue).
fix
Reorder messages in the .proto file so that all referenced messages are defined before their first use.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
proto_ts_schema — npm install proto_ts_schema · libregistry