An experimental WebAssembly port of Google's protoc compiler, compiled from C++ protobuf source. Version 0.0.7 provides protoc functionality for Node.js and browser environments without native binaries. Distributed as an npm package, it supports generating code from .proto files for all standard languages (e.g., JavaScript, Python, C++, Java). The package exposes a command-line tool (when installed globally) and a programmable module. Current release cadence is low (last release 6+ years ago); it is not maintained by Google directly but is a community build. Key differentiator: runs entirely in-process/browser, no native protoc binary required.
npm install google-protocol-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize the WASM compiler, generate JavaScript code from a .proto string, and log the output files.
Switch to native protoc (https://github.com/protocolbuffers/protobuf/releases) or protobuf-es (https://github.com/bufbuild/protobuf-es).
Ensure WASM is served with application/wasm MIME type, or set a timeout to detect failures.
Use 'Javascript' (capital J, rest lowercase) or refer to languageList.
Warm up the module early with onReady, or consider streaming compilation in browsers.
Run 'npm install google-protocol-compiler' or add to package.json.
Ensure require('google-protocol-compiler') is used (not import) and that the variable is named 'generator'.Always invoke generateCode inside the onReady callback or after a promise that waits for readiness.