protoc-binary
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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

Package Sidebar

Install

npm i protoc-binary

Weekly Downloads

239

Version

1.3.0

License

MIT

Unpacked Size

10.6 kB

Total Files

7

Last publish

Collaborators

  • vallyian