Socket
Socket
Sign inDemoInstall

nice-grpc-server-reflection

Package Overview
Dependencies
39
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nice-grpc-server-reflection

Server reflection for nice-grpc


Version published
Weekly downloads
9.5K
increased by19.83%
Maintainers
1
Install size
8.74 MB
Created
Weekly downloads
 

Readme

Source

nice-grpc-server-reflection npm version

Server Reflection for nice-grpc.

Allows to use tools like grpcurl without the need to pass .proto files.

Installation

npm install nice-grpc-server-reflection

Usage

Add the following flags to protoc command:

--descriptor_set_out=path/to/protoset.bin --include_imports

Add ServerReflection service implementation to gRPC server:

import {createServer} from 'nice-grpc';
import {
  ServerReflectionService,
  ServerReflection,
} from 'nice-grpc-server-reflection';
import * as fs from 'fs';

const server = createServer();

// add our own service
server.add(MyService, myServiceImpl);

// add server reflection service
server.add(
  ServerReflectionService,
  ServerReflection(
    fs.readFileSync(path.join('path', 'to', 'protoset.bin')),
    // specify fully-qualified names of exposed services
    [MyService.fullName],
  ),
);

Keywords

FAQs

Last updated on 11 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc