Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ To use Protocol Buffers with JavaScript, you need two main components:
Project Status
===

This project is currently in a working state.
As of v4.0.0, you can directly install the `protoc-gen-js` plugin from npm as
[@protocolbuffers/protoc-gen-js](https://www.npmjs.com/package/@protocolbuffers/protoc-gen-js).

**Support Status**

Expand Down
25 changes: 25 additions & 0 deletions protoc_plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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](https://github.com/protocolbuffers/protobuf/releases), the protobuf compiler.
2. The protobuf-javascript runtime, obtainable from [npm as google-protobuf](https://www.npmjs.com/package/google-protobuf).

Usage:

```js
// 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](https://github.com/protocolbuffers/protobuf-javascript/blob/main/docs/index.md)
for more detailed usage instructions along with the generated code API.
5 changes: 3 additions & 2 deletions protoc_plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@protocolbuffers/protoc-gen-js",
"version": "4.0.0",
"description": "Standalone distribution of the protoc-gen-js plugin for Protocol Buffers",
"version": "4.0.0-1",
"description": "Official standalone distribution of the protoc-gen-js plugin for Protocol Buffers",
"author": "Google Protocol Buffers Team",
"license": "BSD-3-Clause",
"keywords": ["protocol buffers", "protobuf", "protoc-gen-js", "google-protobuf", "protobuf-javascript"],
"repository": {
"type": "git",
"url": "git+https://github.com/protocolbuffers/protobuf-javascript.git"
Expand Down