Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 days 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-28T11:56:55.000Z (about 1 month ago)
- Last Synced: 2024-12-06T04:48:03.589Z (about 1 month ago)
- Topics: converter, protobuf, protobuf3, runtypes, transformer, typescript
- Language: TypeScript
- Homepage:
- Size: 256 KB
- Stars: 0
- Watchers: 2
- 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
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![NPM version](https://img.shields.io/npm/v/protobuf-to-runtypes.svg)](https://www.npmjs.com/package/protobuf-to-runtypes)
[![codecov](https://codecov.io/gh/cobraz/protobuf-to-runtypes/branch/main/graph/badge.svg)](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