1.0.2 • Published 3 years ago

protobuf-to-runtypes v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Generate Runtypes from Protobuf

lifecycle NPM version codecov

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);