An Egg.js plugin that simplifies gRPC server and client setup with auto-configuration and manual configuration options. Version 3.0.6 supports basic unary RPCs (no streaming). It provides a convenient way to define gRPC services and clients by scanning proto files and mapping them to Egg.js services. The plugin is tailored for the Egg.js framework and requires Node >=8.0.0. Compared to other gRPC Node.js libraries, this plugin integrates deeply with Egg.js's plugin system, offering auto-configuration that reduces boilerplate, but with limitations on proto file structure and function naming conventions.
npm install egg-grpc-utilNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic setup for Egg.js gRPC plugin: enabling plugin, configuring auto-configuration for server/client with proto path, and defining a proto file and corresponding service.
Follow naming conventions or use manual configuration with protoArray to specify mappings.
Consider using grpc library directly for streaming use cases.
Ensure proto files are in the correct directory or manually configure protoArray with absolute or relative paths.
Run `npm install grpc --save` to install the grpc peer dependency.
Ensure plugin.js exports { grpcUtil: { enable: true, package: 'egg-grpc-util' } } and that the package is installed.Verify that the proto file exists at the configured protoPath (default: app/proto) or use an absolute path in manual configuration.
Ensure the proto file has consistent naming: package name matches service name and file name (e.g., package example; service example { ... })