| 1 |
# @bufbuild/protobuf |
| 2 |
|
| 3 |
This package provides the runtime library for the [protoc-gen-es](https://www.npmjs.com/package/@bufbuild/protoc-gen-es) |
| 4 |
code generator plugin. |
| 5 |
|
| 6 |
## Protocol Buffers for ECMAScript |
| 7 |
|
| 8 |
A complete implementation of [Protocol Buffers](https://protobuf.dev/) in TypeScript, |
| 9 |
suitable for web browsers, Node.js, Deno, and Bun, created by [Buf](https://buf.build). |
| 10 |
|
| 11 |
**Protobuf-ES** is a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem. It |
| 12 |
provides a comprehensive plugin framework and decouples the base types from RPC functionality. |
| 13 |
|
| 14 |
Some additional features: |
| 15 |
|
| 16 |
- Generates pure TypeScript |
| 17 |
- Plain message objects, no getters/setters |
| 18 |
- Reflection, registries, and custom options |
| 19 |
- 100% conformant against the official Protobuf test suite |
| 20 |
- Standard plugin-based generation, works with the Buf CLI as well as `protoc` |
| 21 |
- Write your own code generators with [@bufbuild/protoplugin](https://www.npmjs.com/package/@bufbuild/protoplugin) |
| 22 |
- Pairs with [@connectrpc/connect](https://www.npmjs.com/package/@connectrpc/connect) for RPC and [@bufbuild/protovalidate](https://www.npmjs.com/package/@bufbuild/protovalidate) for validation |
| 23 |
|
| 24 |
## Installation |
| 25 |
|
| 26 |
```bash |
| 27 |
npm install @bufbuild/protobuf |
| 28 |
``` |
| 29 |
|
| 30 |
## Documentation |
| 31 |
|
| 32 |
To learn how to work with `@bufbuild/protobuf`, check out the docs for the [Runtime API](https://protobufes.com/guides/messages/) |
| 33 |
and the [generated code](https://protobufes.com/reference/generated-code/). |
| 34 |
|
| 35 |
Official documentation for the Protobuf-ES project can be found at [protobufes.com](https://protobufes.com/). |
| 36 |
|
| 37 |
For more information on Buf, check out the official [Buf documentation](https://buf.build/docs/). |
| 38 |
|
| 39 |
## Examples |
| 40 |
|
| 41 |
A complete code example can be found in the **Protobuf-ES** repo [here](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-example). |