grpc-client

0.1.4 • Public • Published

grpc-client

example

var grpcClient = require('grpc-client');
var gc = new grpcClient({host:"localhost:50051",dir:'./',header:{custom:['customvalue']}});
 
gc.proto("helloworld")
  .sayHello({name:"xing"})
  .then(function(res){
    console.log(res);
  })
  .catch(function(err){
    console.log(err);
  })  
 
or  
 
gc.proto("helloworld")
  .call("SayHello")
  .send({name:"xing"})
  .then(function(res){
    console.log(res);
  })
  .catch(function(err){
    console.log(err);
  })

host is grpc server
dir is proto file folder
header is your custom matedata

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i grpc-client

    Weekly Downloads

    1

    Version

    0.1.4

    License

    MIT

    Last publish

    Collaborators

    • cgx9