protoc --js_out=import_style=commonjs,binary:. proto/user.proto

Category: Web App Development

protoc --js_out=import_style=commonjs,binary:. proto/user.proto

Generate JavaScript code from a proto file

Runs the protocol buffer compiler to emit JavaScript modules from user.proto into the current directory. The --js_out flag takes options like import_style=commonjs and the output directory after the colon. The generated files work with the google-protobuf runtime.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.