cool-grpc
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

cool-grpc

Simple, stupid gRPC client for Node written in Typescript

Features

  • Easy to use (inspired by fetch and got)
  • Loading multiple .proto files
  • Automatic message encoding/decoding
  • Unary calls
  • Client streaming
  • Server streaming
  • Hooks

Get Started

npm i cool-grpc
import { makeRequest } from 'cool-grpc'

const protos = ['./helloworld.proto']

makeRequest(protos, {
  host: '0.0.0.0:50051',
  service: 'helloworld.Greeter',
  method: 'SayHello',
  metadata: {},
  data: {
    name: 'world'
  },
  tls: {
    rootCerts: "",
    privateKey: "",
    certChain: ""
  },
  beforeRequest: (req) => {},
  afterResponse: (res) => {}
})
.then(console.log)
.catch(console.error)

Readme

Keywords

Package Sidebar

Install

npm i cool-grpc

Weekly Downloads

3,176

Version

1.2.3

License

MPL-2.0

Unpacked Size

13.5 kB

Total Files

8

Last publish

Collaborators

  • mishushakov