Registry / devops / zaucy-protoc-gen-grpc-web

zaucy-protoc-gen-grpc-web

JSON →
library1.0.3-5jsnpmunverified

Unofficial npm binary distribution of the gRPC web protoc plugin (protoc-gen-grpc-web). Current stable version is 1.0.3-5. Provides the plugin binary for generating gRPC-Web client code from protobuf definitions. Key differentiator: enables npm-based installation instead of manual binary download. No release cadence specified; based on upstream grpc-web releases. Primarily for use with protoc via node.js scripts or global CLI.

npm install zaucy-protoc-gen-grpc-web
INSTALL
IMPORT
SIG · ZAUCY-PROTOC-GEN-G
Z
zaucy-protoc-gen-grpc-web
devopsjavascriptv1.0.3-5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const protocGrpcWebPluginPath = require('zaucy-protoc-gen-grpc-web');
import protocGrpcWebPluginPath from 'zaucy-protoc-gen-grpc-web';
This package does not export an ES module; use CommonJS require.
default
import protocGrpcWebPluginPath from 'zaucy-protoc-gen-grpc-web';
const protocGrpcWebPluginPath = require('zaucy-protoc-gen-grpc-web').default;
The ESM import works if the project supports ES modules; the default export is a string (path). Do not use .default.
default
const protocGrpcWebPluginPath = await import('zaucy-protoc-gen-grpc-web');
const protocGrpcWebPluginPath = await import('zaucy-protoc-gen-grpc-web').default;
Dynamic import returns the module namespace; the default export is directly the string path, not a property.

Use the package to get the full path of the protoc-gen-grpc-web plugin and invoke protoc to generate gRPC-Web client stubs.

const protocGrpcWebPluginPath = require('zaucy-protoc-gen-grpc-web'); const { execSync } = require('child_process'); const protoFile = 'example.proto'; const outDir = './gen'; const cmd = `protoc --plugin=protoc-gen-grpc-web=${protocGrpcWebPluginPath} --grpc-web_out=import_style=commonjs,mode=grpcwebtext:${outDir} ${protoFile}`; execSync(cmd, { stdio: 'inherit' }); console.log('gRPC-Web code generated.');
Debug
Known issues
gotchaThis package only provides the binary path for the plugin. It does not include protoc itself; you must have protoc installed separately.
fix
Install protoc via your system package manager or download from https://github.com/protocolbuffers/protobuf/releases.
affects: >=0.0.0
gotchaOn Windows, npm-installed protoc plugins cannot be used with protoc's --grpc-web_out flag directly. You must use the --plugin flag with the full path.
fix
Use protoc --plugin=protoc-gen-grpc-web=<path> --grpc-web_out=... instead of relying on global PATH.
affects: >=0.0.0
deprecatedThe package is an unofficial distribution and may not be updated in sync with upstream gRPC-web releases.
fix
Consider using the official Google-owned npm package @grpc/proto-loader or building from source.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Unable to execute protoc-gen-grpc-web: exec: "protoc-gen-grpc-web": executable file not found in $PATH
protoc cannot find the plugin binary because it's not on PATH or not specified correctly.
fix
Use the --plugin flag with the full path obtained from require('zaucy-protoc-gen-grpc-web').
Error: Cannot find module 'zaucy-protoc-gen-grpc-web'
Package not installed or import path incorrect.
fix
Run 'npm install zaucy-protoc-gen-grpc-web' and ensure the require/import path matches the package name.
TypeError: protocGrpcWebPluginPath is not a function
Incorrectly treating the exported path as a function; it is a string.
fix
Do not invoke protocGrpcWebPluginPath(); use it directly as a path string.
Upgrade
Version history
1.0.3-5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
Resources
zaucy-protoc-gen-grpc-web — npm install zaucy-protoc-gen-grpc-web · libregistry