grpc-web-ts-compiler

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i grpc-web-ts-compiler

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.92 kB

Total Files

4

Last publish

Collaborators

  • vallyian