You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

grpc-promisify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-promisify

Make gRPC client promisify

0.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

grpc-promisify

gRPC is a high performance, open source, general-purpose RPC framework, grpc-promisify make gRPC client promisify in node.

Installation

$ npm install grpc-promisify

##The Gist

const PROTO_PATH = __dirname + '/hello.proto';
const promisify = require('grpc-promisify');
const grpc = require('grpc');
const hello_proto = grpc.load(PROTO_PATH).helloworld;

function main() {
  const client = new hello_proto.Greeter('localhost:50051', grpc.credentials.createInsecure());
  const user = 'hello';
  
  promisify(client);
  client.sayHello({name: user})
  .then(res => console.log(res.message))
  .catch(err => console.error(err));
}

main();

License

The MIT license.

Keywords

grpc

FAQs

Package last updated on 01 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts