Package Exports
- protoc-binary
- protoc-binary/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (protoc-binary) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
protoc-binary
Downloads Google Protocol Buffers binary wrapped as npm package.
By default, it will download the latest released version.
If an older version is required, add "protoc-binary": "x.x.x"
at the root of your package.json.
Install
npm i -D protoc-binary
To force re-check for latest protoc binary releases, simply run npm ci
.
Alternatively, you can manually invoke the install script node -e "require('protoc-binary/install')"
.
If working in both Windows and WSL, you can invoke the install script to download binaries for both,
however when switching OS you should run npm ci
.
Usage
Node.js | require("protoc-binary").protoc(["--version"]) |
npx | npx protoc --version |
Linux/Powershell | node_modules/.bin/protoc --version |
Windows cmd | node_modules\\.bin\\protoc --version |
API
protoc
/* Function wrapper for protoc binary */
require("protoc-binary").protoc(
args, /* {string[]} protoc arguments */
protoDir /* {string} [optional] absolute path to dir containing .proto files */
);
binary
/* Returns the absolute path to local protoc binary */
require("protoc-binary").binary;
version
/* Returns version of local protoc binary */
require("protoc-binary").version;
Supported versions
See official protoc binaries download page.
- osx-aarch_64.zip
- osx-x86_64.zip
- linux-x86_32.zip
- linux-x86_64.zip
- linux-arm64.zip
- win32.zip
- win64.zip