Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grpc-getting-started

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-getting-started

Demonstration of the use of gRPC and front-end

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

gRPC Getting Started

Demonstration of the use of gRPC and front-end.

Getting Started

Step 1. Install the grpc-web runtime library

$ cd /{your_directory}/grpc-getting-started
$ npm i grpc-web

Step 2. Install the code generator plugin protoc

$ PROTOC_ZIP=protoc-22.2-osx-x86_64.zip
$ curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v22.2/$PROTOC_ZIP
$ sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
$ sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
$ rm -f $PROTOC_ZIP

You can also use the following command to install (macOS):

$ brew install protobuf

Check the version after the installation is complete

$ protoc --version

Step 3. Proceed to install the plugin protoc-gen-js

$ sudo npm i -g protoc-gen-js

Step 4. Compile and execute

Run the following command to compile the .proto file and generate a .js file we can recognize.

You can download protobuf-javascript to test

Or create your own files

proto/example.proto:

syntax = "proto3";

package hello;

// Greeting represents a message you can tell a user.
message Greeting {
  string message = 1;
}

The way to compile it:

$ mkdir hello
$ protoc  --proto_path=./proto --js_out=import_style=commonjs,binary:hello  proto/example.proto

or

$ npm run build

It will generate a file hello/example_pb.js

Licensing

Licensed under the MIT.

Keywords

FAQs

Package last updated on 13 Mar 2023

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