首页 > 解决方案 > 将文件从 file_pb.js 编译为 file.proto

问题描述

我知道如何从编译file.protofile_pb.js使用此命令:

c:\protobuf\bin\protoc.exe --js_out=import_style=commonjs,binary:. .\file.proto

但是,我如何转换file_pb.jsfile.proto

标签: grpcprotogrpc-node

解决方案


You are unlikely to find a tool that does what you are asking for. The process of compiling a .proto file to a programming language was not intended to be reversible. The intention is for the .proto file to be the "source of truth" that directly describes APIs and the structure of the messages.


推荐阅读