šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

grpc-vuex

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-vuex

JavaScript (Vuex) code generator with grpc-web

0.21.0
latest
Source
npm
Version published
Weekly downloads
73
284.21%
Maintainers
1
Weekly downloads
Ā 
Created
Source

grpc-vuex

JavaScript (Vuex) code generator with grpc-web

Install

npm i -g grpc-vuex or yarn global add grpc-vuex

Dependencies (Required!)

protoc
http://google.github.io/proto-lens/installing-protoc.html

protoc-gen-grpc-web
https://github.com/grpc/grpc-web#code-generator-plugin

Run

grpc-vuex <output_file_path> <proto_file_paths ...>

Command Options

grpc-vuex -h

Example

grpc-vuex output.js helloworld.proto --endpoint https://yourdomain.com

helloworld.proto

syntax = "proto3";
package helloworld;
service Greeter {
  rpc SayHello (HelloRequest) returns (HelloReply);
}
message User {
  string name = 1;
  int32 age = 2;
  repeated string children = 3;
}
message HelloRequest {
  repeated User users = 1;
}
message HelloReply {
  repeated User users = 1;
}

output.d.ts

interface User {
  name?:string;
  age?:number;
  children?:string[];
}
interface HelloRequest {
  users?:User[];
}
interface HelloReply {
  users?:User[];
}
export function sayHello(param:HelloRequest):Promise<HelloReply>;

output.js

(omitted)

In your JS code

import { sayHello } from './output'

sayHello({
  users: [
    {
      name: 'foobar',
      age: '99',
      children: ['john', 'mike']
    }
  ]
}).then((res)=>console.log(res))

Keywords

grpc

FAQs

Package last updated on 20 Jun 2019

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