From 5b7da666493b842628a22473505b8f14efa7cf40 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Thu, 23 Oct 2025 21:17:50 -0700 Subject: [PATCH] Update READMEs and add keywords for npm --- README.md | 3 ++- protoc_plugin/README.md | 25 +++++++++++++++++++++++++ protoc_plugin/package.json | 5 +++-- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 protoc_plugin/README.md diff --git a/README.md b/README.md index 6b83397..2e1aec1 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/protoc_plugin/README.md b/protoc_plugin/README.md new file mode 100644 index 0000000..8f30ac7 --- /dev/null +++ b/protoc_plugin/README.md @@ -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 +``` + +`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. diff --git a/protoc_plugin/package.json b/protoc_plugin/package.json index 413a18b..83a2263 100644 --- a/protoc_plugin/package.json +++ b/protoc_plugin/package.json @@ -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"