{"id":15392374,"url":"https://github.com/activeguild/grpc-json-mock","last_synced_at":"2025-07-25T09:12:41.124Z","repository":{"id":38782520,"uuid":"246236021","full_name":"activeguild/grpc-json-mock","owner":"activeguild","description":" This is a mock of grpc used for front-end development. Prepare the server using nodejs.","archived":false,"fork":false,"pushed_at":"2023-07-18T21:14:43.000Z","size":1229,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T08:12:20.798Z","etag":null,"topics":["grpc","grpc-mock","grpc-web","mock"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/grpc-mocky","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/activeguild.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-03-10T07:34:47.000Z","updated_at":"2022-07-12T03:42:41.000Z","dependencies_parsed_at":"2024-10-18T23:09:44.101Z","dependency_job_id":null,"html_url":"https://github.com/activeguild/grpc-json-mock","commit_stats":{"total_commits":105,"total_committers":6,"mean_commits":17.5,"dds":0.5904761904761905,"last_synced_commit":"872606fa44927f0b81bff3ebc86d7756f91f0343"},"previous_names":["activeguild/grpc-mocky"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/activeguild/grpc-json-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fgrpc-json-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fgrpc-json-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fgrpc-json-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fgrpc-json-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activeguild","download_url":"https://codeload.github.com/activeguild/grpc-json-mock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fgrpc-json-mock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266305287,"owners_count":23908416,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["grpc","grpc-mock","grpc-web","mock"],"created_at":"2024-10-01T15:14:41.842Z","updated_at":"2025-07-25T09:12:41.099Z","avatar_url":"https://github.com/activeguild.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to grpc-json-mock 😀\u003c/h1\u003e\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/actions/setup-node\"\u003e\u003cimg alt=\"GitHub Actions status\" src=\"https://github.com/activeguild/grpc-json-mock/workflows/automatic%20release/badge.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Introduction\n\n- A GRPC mock server for front-end development.\n- Multiple APIs are supported.\n- Supports the following APIs\n  - unary\n  - serverStreming\n  - clientStreming\n  - duplexStreming\n\n# Install\n\n```shell\nnpm i -D grpc-json-mock\n```\n\n# Cli\n\n### gen-grpc-tamplate\n\n- By specifying a proto file, you can output a json template for use in mock.\n\n```shell\nnode ./node_module/.bin/gen-grpc-template {path}\n```\n\n| Parameter | Description                                                     |\n| --------- | --------------------------------------------------------------- |\n| path      | Set the directory where the proto file or proto file is located |\n\n- option\n\n| option | Description         |\n| ------ | ------------------- |\n| -i     | import another path |\n\n- e.g.\n\n```helloWorld.proto\nsyntax = \"proto3\";\npackage helloworld;\n\nservice Greeter {\n  rpc unary (UnaryRequest) returns (UnaryResponse) {}\n  rpc serverStreaming (UnaryRequest) returns (stream UnaryResponse) {}\n  rpc clientStreaming (stream UnaryRequest) returns (UnaryResponse) {}\n  rpc duplexStreaming (stream UnaryRequest) returns (stream UnaryResponse) {}\n}\n\nmessage UnaryRequest {\n  string name = 1;\n}\n\nmessage UnaryResponse {\n  string message = 1;\n}\n```\n\ngenerate...\n\n```service.json\n{\n  \"protos\": [\n    {\n      \"path\": \"example/protos/helloWorld.proto\",\n      \"pkg\": \"helloworld\",\n      \"options\": {},\n      \"services\": [\n        {\n          \"name\": \"Greeter\",\n          \"methods\": [\n            { \"name\": \"unary\", \"output\": {} },\n            { \"name\": \"serverStreaming\", \"output\": {} },\n            { \"name\": \"clientStreaming\", \"output\": {} },\n            { \"name\": \"duplexStreaming\", \"output\": {} }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n# Interface\n\n### run\n\n| Parameter | Type           | Description                                                                                                                                                                                                                            |\n| --------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| address   | string         | Set the address of the mock server to be started. default 0.0.0.0                                                                                                                                                                      |\n| port      | string         | Set the port of the mock server to be started. default 50051                                                                                                                                                                           |\n| protos    | Array\\\u003cproto\\\u003e | \u003cb\u003eRequired.\u003c/b\u003e Set proto and mock data to be loaded into mock server. \u003cbr\u003e e.g. https://github.com/activeguild/grpc-json-mock/blob/master/example/service.json \u003cbr\u003e https://github.com/activeguild/grpc-json-mock#user-content-proto |\n\n### proto\n\n| Parameter | Type             | Description                                                                         |\n| --------- | ---------------- | ----------------------------------------------------------------------------------- |\n| path      | string           | \u003cb\u003eRequired.\u003c/b\u003e Set location of proto file.                                        |\n| pkg       | string           | \u003cb\u003eRequired.\u003c/b\u003e Set pkgName from ptoro file.                                       |\n| options   | string           | https://github.com/grpc/grpc-node/tree/master/packages/proto-loader                 |\n| services  | Array\\\u003cservice\\\u003e | \u003cb\u003eRequired.\u003c/b\u003e https://github.com/activeguild/grpc-json-mock#user-content-service |\n\n### service\n\n| Parameter | Type            | Description                                                                        |\n| --------- | --------------- | ---------------------------------------------------------------------------------- |\n| name      | string          | \u003cb\u003eRequired.\u003c/b\u003e Set service name from ptoro file.                                 |\n| methods   | Array\\\u003cmethod\\\u003e | \u003cb\u003eRequired.\u003c/b\u003e https://github.com/activeguild/grpc-json-mock#user-content-method |\n\n### method\n\n| Parameter      | Type                      | Description                                                                  |\n| -------------- | ------------------------- | ---------------------------------------------------------------------------- |\n| name           | string                    | \u003cb\u003eRequired.\u003c/b\u003e Set method name from ptoro file.                            |\n| output         | Object \\| Array\\\u003cobject\\\u003e | Set response from server.                                                    |\n| streamInterval | number                    | Set the sense of server streaming.Unit is msec. default 1000                 |\n| error          | Object                    | Set grpc error. \u003cbr\u003e https://cloud.google.com/apis/design/errors#error_model |\n\n# e.g.\n\nhttps://github.com/activeguild/grpc-json-mock/tree/master/example\n\n# License\n\n- [MIT](https://github.com/activeguild/grpc-json-mock/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveguild%2Fgrpc-json-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factiveguild%2Fgrpc-json-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveguild%2Fgrpc-json-mock/lists"}