grpc-web-ts-compiler
v1.0.0
Published
gRPC browser client generator for js and d.ts files for Google's Protocol Buffers
Downloads
1
Maintainers
Readme
grpc-web-ts-compiler
Generate browser client (js + d.ts) files from proto files using protoc and grpc-web.
The server must also implement grpc-web for this to work.
Install
npm install --dave-dev grpc-web-ts-compiler
Notes regarding included google-protobuf and @improbable-eng/grpc-web libs:
if you're not using a bundler like webpack, depending on how your frontend is built and consumed, you might get missing function errors; if this happens, ensure these are available at runtime.
if you're using a bundler that creates a
licenses.txt
file during build but libs are not included, you need to install them separately as production dependencies, to be corectly picked up.
Usage
npx proto "path/to/proto/dir" "path/to/generated/js_ts/dir"
Note only the top level proto files are processed by protoc binary, so ensure no subdirs are used