{"id":16896650,"url":"https://github.com/thesayyn/protoc-gen-ts","last_synced_at":"2025-05-15T20:02:17.824Z","repository":{"id":37266825,"uuid":"223785732","full_name":"thesayyn/protoc-gen-ts","owner":"thesayyn","description":"Compile protocol buffer messages to TypeScript.","archived":false,"fork":false,"pushed_at":"2024-03-13T23:11:58.000Z","size":65233,"stargazers_count":336,"open_issues_count":25,"forks_count":70,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-14T02:19:59.215Z","etag":null,"topics":["enums","grpc","grpc-client","grpc-node","grpc-typescript","grpc-web","proto-files","protoc-gen","protoc-plugin","protocol-buffers","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thesayyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["thesayyn"],"open_collective":"protoc-gen-ts","custom":["https://www.buymeacoffee.com/thesayyn"]}},"created_at":"2019-11-24T17:50:33.000Z","updated_at":"2024-04-10T17:11:49.000Z","dependencies_parsed_at":"2024-04-13T17:23:19.465Z","dependency_job_id":"e224c8ad-4b51-4069-83c4-97419cf7bba2","html_url":"https://github.com/thesayyn/protoc-gen-ts","commit_stats":{"total_commits":111,"total_committers":13,"mean_commits":8.538461538461538,"dds":"0.16216216216216217","last_synced_commit":"5fbd729298882efcdc69958e8941ffa5078d0e8f"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesayyn%2Fprotoc-gen-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesayyn%2Fprotoc-gen-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesayyn%2Fprotoc-gen-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesayyn%2Fprotoc-gen-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesayyn","download_url":"https://codeload.github.com/thesayyn/protoc-gen-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378133,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enums","grpc","grpc-client","grpc-node","grpc-typescript","grpc-web","proto-files","protoc-gen","protoc-plugin","protocol-buffers","typescript"],"created_at":"2024-10-13T17:32:29.111Z","updated_at":"2025-04-08T01:37:43.368Z","avatar_url":"https://github.com/thesayyn.png","language":"TypeScript","funding_links":["https://github.com/sponsors/thesayyn","https://opencollective.com/protoc-gen-ts","https://www.buymeacoffee.com/thesayyn"],"categories":[],"sub_categories":[],"readme":"# Protoc Gen Typescript \r\n\r\n![conformance](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fthesayyn%2Fprotoc-gen-ts%2Frust-rewrite%2Finfra%2Fstats.json\u0026query=percentile\u0026suffix=%25\u0026label=conformance)\r\n[![test](https://github.com/thesayyn/protoc-gen-ts/actions/workflows/test.yaml/badge.svg)](https://github.com/thesayyn/protoc-gen-ts/actions/workflows/test.yaml)\r\n[![npm](https://img.shields.io/npm/v/protoc-gen-ts)](https://www.npmjs.com/package/protoc-gen-ts?activeTab=versions)\r\n[![npm](https://img.shields.io/npm/dm/protoc-gen-ts)](https://www.npmjs.com/package/protoc-gen-ts?activeTab=versions)\r\n[![npm](https://opencollective.com/protoc-gen-ts/tiers/backer/badge.svg?label=Backer\u0026color=brightgreen)](https://opencollective.com/protoc-gen-ts)\r\n\r\nCompile `.proto` files to plain TypeScript. Supports gRPC Node and gRPC Web.\r\n\r\n\u003e [!NOTE] \r\n\u003e As of 2024, this project has adopted Rust as its primary programming language, replacing JavaScript.\r\n\u003e See [the issue](https://github.com/thesayyn/protoc-gen-ts/issues/255) for the details.\r\n\r\n## Contributing\r\n\r\nI have limited availability to consistently maintain this project, as my time is primarily allocated to cutting new releases and implementing fixes on an ad hoc basis.\r\n\r\n[See issues that needs help](https://github.com/thesayyn/protoc-gen-ts/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)\r\n\r\n[See issues for newcomers](https://github.com/thesayyn/protoc-gen-ts/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)\r\n \r\nBecome a maintainer? Send an [email](mailto:thesayyn@gmail.com?subject=Become%20a%20maintainer)\r\n\r\n## Features\r\n\r\n- Passes all required conformance tests\r\n- Supports well-known types\r\n- Supports [gRPC](docs/rpc.md) (`@grpc/grpc-js`)\r\n- Supports [gRPC Web](docs/rpc.md) (`grpc-web`)\r\n- Supports json encoding (`toJson`, `fromJson`)\r\n- Supports binary encoding (`toBinary`, `fromBinary`)\r\n- Optimized for [de]serialization speed.\r\n\r\n## Usage\r\n\r\n```sh\r\nnpm install -g protoc-gen-ts\r\n```\r\n\r\n### Protoc\r\n\r\n```properties\r\nprotoc -I=sourcedir --ts_out=dist myproto.proto\r\n```\r\n\r\n### Buf\r\n```yaml\r\nversion: v1\r\nplugins:\r\n  - name: ts\r\n    path: ./node_modules/.bin/protoc-gen-ts\r\n    out: ./dist\r\n```\r\n\r\n### Example\r\n\r\n```proto\r\nsyntax = \"proto3\";\r\n\r\nenum Role {\r\n    ADMIN = 0;\r\n    MOD = 1;\r\n}\r\n\r\nmessage Author {\r\n    Role role = 2;\r\n    oneof id_or_name {\r\n        string id = 4;\r\n        string name = 5;\r\n    }\r\n}\r\n```\r\n\r\n\r\n```typescript\r\nconst author = Author.fromJson({\r\n    role: Kind.ADMIN,\r\n    name: \"mary poppins\",\r\n});\r\n\r\n// Serialize to binary\r\nconst bytes: Uint8Array = author.toBinary();\r\n\r\n// Deserialize from binary\r\nconst received: Change = Change.fromBinary(bytes);\r\n\r\nconsole.log(received.toJson())\r\n```\r\n\r\n## Development\r\n\r\n```sh\r\n./infra/test.sh\r\n```\r\n\r\n## Contributors\r\n\r\n![GitHub Contributors Image](https://contrib.rocks/image?repo=thesayyn/protoc-gen-ts)\r\n\r\n## Support\r\n\r\nWe need your constant support to keep protoc-gen-ts well maintained and add new features.\r\n\r\nIf your corporate has a OSS funding scheme, please consider supporting us monthly through open collective.\r\n\r\n\u003ca href=\"https://opencollective.com/protoc-gen-ts\"\u003e\r\n\u003cimg height=\"100px\" src=\"https://opencollective.com/protoc-gen-ts/tiers/backer.svg?avatarHeight=36\"\u003e\r\n\u003c/a\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesayyn%2Fprotoc-gen-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesayyn%2Fprotoc-gen-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesayyn%2Fprotoc-gen-ts/lists"}