{"id":18262857,"url":"https://github.com/midwayjs/grpc-helper","last_synced_at":"2026-03-11T16:31:32.101Z","repository":{"id":45241973,"uuid":"329021794","full_name":"midwayjs/grpc-helper","owner":"midwayjs","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-15T03:50:35.000Z","size":43,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T23:02:58.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/midwayjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-12T15:01:31.000Z","updated_at":"2024-10-25T10:44:57.000Z","dependencies_parsed_at":"2023-01-20T01:04:42.588Z","dependency_job_id":null,"html_url":"https://github.com/midwayjs/grpc-helper","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midwayjs%2Fgrpc-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midwayjs%2Fgrpc-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midwayjs%2Fgrpc-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midwayjs%2Fgrpc-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/midwayjs","download_url":"https://codeload.github.com/midwayjs/grpc-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246678973,"owners_count":20816400,"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":[],"created_at":"2024-11-05T11:09:05.398Z","updated_at":"2026-03-11T16:31:32.069Z","avatar_url":"https://github.com/midwayjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Midway gRPC interface generator\n\ncode fork from https://github.com/AlexDaSoul/nestjs-proto-gen-ts\n\n\n## Installation\n\n```bash\n$ npm install @midwayjs/grpc-helper --save-dev\n```\n\n\n## Example\n\nProtobuf file hero-proto/hero.proto:\n\n```proto\nsyntax = \"proto3\";\n\npackage hero;\n\nservice HeroesService {\n  rpc FindOne (HeroById) returns (Hero) {}\n}\n\nmessage HeroById {\n  int32 id = 1;\n}\n\nmessage Hero {\n  int32 id = 1;\n  string name = 2;\n}\n```\n\nGenerate interfaces:\n\n```bash\n$ tsproto --path ./hero-proto\n```\n\nOutput:\n\n```ts\nimport * as grpc from '@midwayjs/grpc';\n\nexport namespace hero {\n  export interface HeroService {\n    findOne(data: HeroById): Promise\u003cHero\u003e;\n  }\n  /**\n   * HeroService client interface\n   */\n  export interface HeroServiceClient {\n    findOne(options?: grpc.IClientOptions): grpc.IClientUnaryService\u003cHeroById, Hero\u003e;\n  }\n  export interface HeroById {\n    id?: number;\n  }\n  export interface Hero {\n    id?: number;\n    name?: string;\n  }\n}\n\n\n```\n\n## Usage\n\nBase usage:\n```bash\n$ tsproto --path grpc-proto\n```\nOutput dir:\n```bash\n$ tsproto --path grpc-proto --output any-dir\n```\nTarget files:\n```bash\n$ tsproto --path grpc-proto --target one.proto two.proto\n```\nIgnore directories or files:\n```bash\n$ tsproto --path grpc-proto --ignore grpc-proto/ignore-dir\n```\n\n## Options\n\nThe following options are available:\n\n```\n  --version, -v   Show version number                                  [boolean]\n  --help, -h      Show help                                            [boolean]\n  --path, -p      Path to root directory                      [array] [required]\n  --output, -o    Path to output directory                              [string]\n  --target, -t    Proto files                      [array] [default: [\".proto\"]]\n  --ignore, -i    Ignore file or directories\n                                      [array] [default: [\"node_modules\",\"dist\"]]\n  --comments, -c  Add comments from proto              [boolean] [default: true]\n  --verbose       Log all output to console            [boolean] [default: true]\n  --keepCase, -k  keep property case                   [boolean] [default: true]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidwayjs%2Fgrpc-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmidwayjs%2Fgrpc-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidwayjs%2Fgrpc-helper/lists"}