npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

io-grpc

v0.3.2

Published

an easy rpc plan with grpc

Readme

IO-GRPC

NPM version

an sample rpc-framework build with grpc for node.js. easy used, fast & high-performance.

Service side

for create service side.

load(protoFile)

load proto file to generate service description

decorate(rpc)

addTLS(serviceCertificates)

bind(port)

use(middlewareFn)

addService(name,middlewares,callback(stream))

Client side

for create client side

load(protoFile)

addAuth(clientCertificates)

decorate(rpc)

use(middlewareFn)

route(name, data, callback)

build proto

syntax = "proto3";

option java_multiple_files = true;
option java_package= "io.grpc.myserver.route";
option objc_class_prefix = "RTG";

package route;

service Route {
  rpc Chat(stream Message) returns (stream routeMessage) {}
  rpc GetChat(stream Message) returns (stream routeMessage) {}
  rpc Trans (stream Message) returns (stream routeMessage) {}
}

message TransMessage {
  string name = 1;
  int32 age = 2;
  bytes birthday = 3;
}

message Message {
  string content = 1;
}

service Test {
  rpc Chat(stream Message) returns (stream routeMessage) {}
  rpc GetChat(stream GetMessage) returns (stream routeMessage) {}
}

message GetMessage {
  string route = 1;
}

message routeMessage {
  string content = 1;
}

build service

var createRpc = require('./io-grpc').createServiceRpc;

let serviceRpc = createRpc();
var route = serviceRpc.load(__dirname + '/grpc.service.proto').route;


serviceRpc.addService('route/chat', function(call) {
  console.log(call.body);
  call.write('i am xuezi');
});


serviceRpc.addService('test/getChat', function(call) {
  console.log(call.body, 1);
  serviceRpc.route(call.body.route, { content: 'im xuezi trans' }, function(recall) {
    let body = recall.body;
    console.log(body, 2);
    call.write(body);
  });
});

serviceRpc.addService('test/chat', function(call) {
  console.log(call.body);
  call.write('i am xuezi11');
});
serviceRpc.addRoute('route/trans', function(call) {
  console.log(call.body, 'trans');
});

serviceRpc.decorate(route);

serviceRpc.addTLS({
  ca: __dirname + '/ca.crt',
  cert: __dirname + '/server.crt',
  key: __dirname + '/server.key'
});

var server = serviceRpc.bind('0.0.0.0:5052');
console.log('rpc server start at:', '0.0.0.0:5052');

build client

var createClient = require('./io-grpc').createClientRpc;
var clientRpc = createClient();
var express = require('express');
var app = express();
let route = clientRpc.load(__dirname + '/grpc.service.proto').route;
clientRpc.addAuth({
  ca: __dirname + '/ca.crt',
  cert: __dirname + '/client.crt',
  key: __dirname + '/client.key'
});
clientRpc.decorate(route.Route, 'localhost:5052');

clientRpc.route('chat', { content: 'i am gaubee' }, function(call) {
  console.log(call.body);
});

clientRpc.addService('trans', function(call) {
  console.log(call.body, 'from rote');
  call.write({ content: 'i am gaubee' });
});

app.listen(2222);

route client

var createClient = require('./io-grpc').createClientRpc;
var clientRpc = createClient();

let route = clientRpc.load(__dirname + '/grpc.service.proto').route;
clientRpc.addAuth({
  ca: __dirname + '/ca.crt',
  cert: __dirname + '/client.crt',
  key: __dirname + '/client.key'
});
clientRpc.decorate(route.Test, 'localhost:5052');

clientRpc.route('chat', { content: 'i am chaos' }, function(call) {
  console.log(call.body);
});

clientRpc.route('getChat', { route: 'route/trans' }, function(call) {
  console.log(call.body);
});