protobuf-to-runtypes
v1.0.2
Published
Convert protobuf to runtypes
Downloads
5
Readme
Generate Runtypes from Protobuf
This CLI and library aim to provide an easy way to convert Protobuf to Runtypes.
We are thankful for all help with adding new functionality, fixing issues, or improve the package. Feel free to open issues and pull requests ❤️
Quickstart
▶ npx protobuf-to-runtypes -i protobuf.proto -o protobuf.ts
or
▶ cat https://some-url.com/my-api.proto | npx protobuf-to-runtypes -o protobuf.ts
Documentation
Apart from this README, you can find details and examples of using the SDK in the following places:
Example
import { parseToGenerator } from 'protobuf-to-runtypes';
import { generateRuntypes } from 'generate-runtypes';
const protobuf = await readFile('my-protobuf.proto');
const toGenerator = await parseToGenerator(protobuf);
const sourceCode = await generateRuntypes(toGenerator);