https://github.com/simenandre/protobuf-to-runtypes
Generate Runtypes from Protobuf files 🎉
https://github.com/simenandre/protobuf-to-runtypes
converter protobuf protobuf3 runtypes transformer typescript
Last synced: about 2 months ago
JSON representation
Generate Runtypes from Protobuf files 🎉
- Host: GitHub
- URL: https://github.com/simenandre/protobuf-to-runtypes
- Owner: simenandre
- License: apache-2.0
- Created: 2021-05-13T20:01:03.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-20T08:07:29.000Z (4 months ago)
- Last Synced: 2025-05-03T06:05:08.627Z (2 months ago)
- Topics: converter, protobuf, protobuf3, runtypes, transformer, typescript
- Language: TypeScript
- Homepage:
- Size: 247 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Generate Runtypes from Protobuf
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://www.npmjs.com/package/protobuf-to-runtypes)
[](https://codecov.io/gh/cobraz/protobuf-to-runtypes)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
```shell
▶ npx protobuf-to-runtypes -i protobuf.proto -o protobuf.ts
```or
```shell
▶ 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:- [API Documentation][docs]
## Example
```typescript
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);
```[runtypes]: https://github.com/pelotom/runtypes
[docs]: ./docs