You can use the flag -I
or -proto_path
to specify the path to your protobuffer. The next flag specifies the language to compile to. The Go
command is fairly well documented but the Node.js documents seem to only show how to dynamically load a proto file. This is how you generate a compiled file for use in your Node.js project.
protoc --proto_path=$SRC_PATH --go_out=plugins=grpc:$DEST_PATH $SRC_PATH/service.proto
protoc --proto_path=$SRC_PATH --js_out=import_style=commonjs,binary:$DEST_PATH --grpc_out=./ --plugin=protoc-gen-grpc=node_modules/grpc-tools/bin/grpc_node_plugin $SRC_PATH/service.proto