egg-grpc-client-ts-plus
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

egg-grpc-client-ts-plus

TypeScript version of egg grpc client plugin.

Inspired by egg-grpc-client and egg-grpc-client-ts.

NPM version build status Test coverage David deps Known Vulnerabilities npm download

This package is cloned from [egg-grpc-client-ts]. The only difference is that you can define max_send_message_length and max_receive_message_length in the config

Install

$ npm i egg-grpc-client-ts-plus --save

Usage

// {app_root}/config/plugin.[t|j]s
exports.grpcClient = {
  enable: true,
  package: 'egg-grpc-client-ts-plus',
};

Configuration

// {app_root}/config/config.default.[t|j]s
exports.grpcClient = {
  clients: [
    {
      name: 'main',
      protoPath: 'app/proto/main',
      host: '0.0.0.0',
      port: 50051,
      maxSendMessageLength: -1,
      maxReceiveMessageLength: 4 * 1024 * 1024,
    },
  ],
};

see config/config.default.ts for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Test

# start test grpc server
npm run test-server

# In another shell, run:
npm run test-local

Package Sidebar

Install

npm i egg-grpc-client-ts-plus

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

16.6 kB

Total Files

8

Last publish

Collaborators

  • rushrunner