New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grpc-service-interceptor

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-service-interceptor

Creates services adding interceptors support for its methods

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gRPC Service Interceptor

Creates a service from a given gRPC server, allowing you to configure interceptors for its methods.

Installation

$ npm install grpc-service-interceptor --save

Usage

const GrpcServiceInterceptor = require('grpc-service-interceptor');

const service = new GrpcServiceInterceptor({
  grpcServer,
  grpcServiceDefinition,
});

const firstInterceptor = async (ctx, next) => {
  // ctx.call, ctx.callback
  next();
};

const secondInterceptor = async (ctx, next) => {
  next();
};

const firstHandler = async (ctx) => {
  // handle response
};

const secondHandler = async (ctx) => {
  // handle response
};

service.addMethod('methodName', firstInterceptor, secondInterceptor, firstHandler);
service.addMethod('anotherMethodName', firstInterceptor, secondInterceptor, secondHandler);

service.configure();

Keywords

FAQs

Package last updated on 14 Jul 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc