{"id":28717249,"url":"https://github.com/edvardchen/node_protoc2","last_synced_at":"2026-05-15T01:36:07.851Z","repository":{"id":66347693,"uuid":"348693797","full_name":"edvardchen/node_protoc2","owner":"edvardchen","description":"Compile 64-int types to string when generating static code for protobuf in JavaScript","archived":false,"fork":false,"pushed_at":"2021-05-08T08:39:25.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T18:05:17.593Z","etag":null,"topics":["nodejs","protobuf","protoc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edvardchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-17T12:02:50.000Z","updated_at":"2022-08-05T07:01:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c7f2c57-164c-437b-abdf-36db20ac48bc","html_url":"https://github.com/edvardchen/node_protoc2","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/edvardchen/node_protoc2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvardchen%2Fnode_protoc2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvardchen%2Fnode_protoc2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvardchen%2Fnode_protoc2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvardchen%2Fnode_protoc2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edvardchen","download_url":"https://codeload.github.com/edvardchen/node_protoc2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvardchen%2Fnode_protoc2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33050337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["nodejs","protobuf","protoc"],"created_at":"2025-06-15T03:13:52.486Z","updated_at":"2026-05-15T01:36:07.843Z","avatar_url":"https://github.com/edvardchen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node_protoc2\n\nWrap [grpc-tools](https://github.com/grpc/grpc-node/tree/master/packages/grpc-tools) with additional ability that compile protobuf 64-int types to string automatically\n\n## Why\n\nThe [official](https://developers.google.com/protocol-buffers/docs/proto#scalar) table that shows the type specified in the `.proto` file and the corresponding type in target program language doesn't include the JavaScript example. So here is:\n\n| .proto Type                                         | JavaScript                                                                                                |\n| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |\n| double, float, int32,uint32,sint32,fixed32,sfixed32 | number                                                                                                    |\n| int64,uint64,sint64,fixed64,sfixed64                | number (maybe overflow)                                                                                   |\n| bool                                                | boolean                                                                                                   |\n| string                                              | string                                                                                                    |\n| byte                                                | [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |\n\nBy default the official compiler `protoc` will compile all protobuf `64-int` types into the JavaScript number type that maybe would cause overflow.\n\nTo work around this, you need to adding `jstype` annotation for every `64-int` field because `protoc` doesn't provide any global compile option. Somehow this is annoying when the `.proto` files are not maintained by other teams.\n\nSo, I wrote this tool to make it easy.\n\n## Usage\n\nYou can generate static codes in JavaScript from `.proto` files through the following command:\n\n```bash\nnpx node_protoc2 --out_dir output_folder foo.proto\n```\n\nAll proto `64-int` types would be compiled into JavaScript `string` type\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedvardchen%2Fnode_protoc2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedvardchen%2Fnode_protoc2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedvardchen%2Fnode_protoc2/lists"}