New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

type-grpc

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

type-grpc

TypeScript GRPC proto generator

latest
Source
npmnpm
Version
1.0.0-alpha
Version published
Maintainers
1
Created
Source

type-grpc

type-grpc is typescript library to generate grpc service definitions

installation

npm install type-grpc

OR

yarn add type-grpc

example

import {
  Service,
  RPC,
  Input,
  Message,
  Field,
  Metadata,
  RPCMeta,
} from 'type-grpc';

@Message()
class ServiceMethodResponse {
  @Field()
  uuid: string;

  @Field()
  message: string;
}

@Message()
export class MethodInput {
  @Field()
  name: string;
}

@Service()
export class ServiceName {
  @RPC(type => ServiceMethodResponse, {})
  async methodName(
            @Metadata() metadata: RPCMeta,
            @Input(type => MethodInput, { nullable: true }) input: MethodInput,
  ): Promise<ServiceMethodResponse> {
    return {
      uuid: 'f23fd-434dfs-4324fdsf-43432fd',
      message: `Hello ${input.name}`,
    };
  }
}

warning

this package is under development, so it's not production ready. any contributions in any way is appreciated

Keywords

typescript

FAQs

Package last updated on 16 Dec 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