tree: 23eeaa917cbadd66d5991b127d420b1e268bf663 [path history] [tgz]
  1. bin/
  2. .gitignore
  3. cli.js
  4. download-protoc-gen-js.js
  5. index.js
  6. LICENSE.md
  7. package-lock.json
  8. package.json
  9. README.md
protoc_plugin/README.md

This package is an official distribution of protoc-gen-js plugin generating javascript protobuf messages with protoc.

Aside from this package, you will need:

  1. protoc, the protobuf compiler.
  2. The protobuf-javascript runtime, obtainable from npm as google-protobuf.

Usage:

// Assuming you installed this package as: npm install --save-dev @protocolbuffers/protoc-gen-js

protoc --plugin=./node_modules/.bin/protoc-gen-js --js_out=import_style=commonjs,binary:. messages.proto <additional .proto files>

protoc will search PATH for protoc-gen-js if --plugin is omitted.

This command will generate javascript protobuf files (with a _pb.js suffix for commonjs imports) alongside their respective schema files (e.g. messages_pb.js).

Please see our full documentation for more detailed usage instructions along with the generated code API.