Skip to content

infodusha/grpc-promise-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-promise-client

Wrapper around @grpc/grpc-js client that allows to use promises instead of callbacks.

Installation

npm i grpc-promise-client

Usage

import { credentials } from "@grpc/grpc-js";
import { grpcClientFactory } from "grpc-promise-client";
import { BookServiceClient } from "./book_grpc_pb";

const createGrpcClient = grpcClientFactory({
  defaultAddress: "localhost:50000",
  credentials: credentials.createInsecure(),
});

const bookService = createGrpcClient(BookServiceClient);
const res = await bookService.getBook({ name: "Harry Potter" });

Contributing

Contributions are always welcome!

License

Apache-2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published