Skip to content

Instantly share code, notes, and snippets.

@ksmithut
Created August 3, 2017 19:18
Show Gist options
  • Save ksmithut/4fce0d716460326510d2e8d98a34853e to your computer and use it in GitHub Desktop.
Save ksmithut/4fce0d716460326510d2e8d98a34853e to your computer and use it in GitHub Desktop.
Describes how do to static code gen for grpc
yarn add grpc-tools
# In package.json scripts...
grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:. \
--grpc_out=. \
--plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` \
path/to/proto/file.proto
# Proto Example: https://github.com/grpc/grpc/blob/master/examples/protos/helloworld.proto
# Server Example: https://github.com/grpc/grpc/blob/master/examples/node/static_codegen/greeter_server.js
# Client Example: https://github.com/grpc/grpc/blob/master/examples/node/static_codegen/greeter_client.js
@thangtv611
Copy link

Thanks very much. Lost 1 hour for looking this 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment