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 🙏

© 2024 – Pkg Stats / Ryan Hefner

kgrpc

v1.24.4

Published

gRPC Library for Node

Downloads

2

Readme

npm

Node.js gRPC Library

This library is now only receiving bug fixes and runtime compatibility updates. In April 2021 it will be deprecated and will no longer receive any updates.

PREREQUISITES

  • node: This requires node to be installed, version 4.0 or above. If you instead have the nodejs executable on Debian, you should install the nodejs-legacy package.

  • Note: If you installed node via a package manager and the version is still less than 4.0, try directly installing it from nodejs.org.

INSTALLATION

Install the gRPC NPM package

npm install grpc

BUILD FROM SOURCE

The following command can be used to build from source when installing the package from npm:

npm install grpc --build-from-source

The --build-from-source option will work even when installing another package that depends on grpc. To build only grpc from source, you can use the argument --build-from-source=grpc.

ABOUT ELECTRON

The official electron documentation recommends to build all of your native packages from source. While the reasons behind this are technically good - many native extensions won't be packaged to work properly with electron - the gRPC source code is fairly difficult to build from source due to its complex nature, and we're also providing working electron pre-built binaries. Therefore, we recommend that you do not follow this model for using gRPC with electron. Also, for the same reason, electron-rebuild will always build from source. We advise you to not use this tool if you are depending on gRPC. Please note that there's not just one way to get native extensions running in electron, and that there's never any silver bullet for anything. The following instructions try to cater about some of the most generic ways, but different edge cases might require different methodologies.

The best way to get gRPC to work with electron is to do this, possibly in the postinstall script of your package.json file:

npm rebuild --target=2.0.0 --runtime=electron --dist-url=https://atom.io/download/electron

Note that the 2.0.0 above is the electron runtime version number. You will need to update this every time you go on a different version of the runtime.

If you have more native dependencies than gRPC, and they work better when built from source, you can explicitely specify which extension to build the following way:

npm rebuild --build-from-source=sqlite3 --target=2.0.0 --runtime=electron --dist-url=https://atom.io/download/electron

This way, if you depend on both grpc and sqlite3, only the sqlite3 package will be rebuilt from source, leaving the grpc package to use its precompiled binaries.

BUILD IN GIT REPOSITORY

  1. Clone the grpc-node Git Repository.
  2. Run git submodule update --init --recursive from the repository root.
  3. Run cd packages/grpc-native-core.
  4. Run npm install --build-from-source.
  • Note: On Windows, this might fail due to nodejs issue #4932 in which case, you will see something like the following in npm install's output (towards the very beginning):

     ..
     Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
     WINDOWS_BUILD_WARNING
      "..\IMPORTANT: Due to https:\github.com\nodejs\node\issues\4932, to build this library on Windows, you must first remove C:\Users\jenkins\.node-gyp\4.4.0\include\node\openssl"
      ...
      ..

    To fix this, you will have to delete the folder C:\Users\<username>\.node-gyp\<node_version>\include\node\openssl and retry npm install

CONFIGURE BINARIES' LOCATION

You can configure the location from which the pre-compiled binaries are downloaded during installation.

npm install --grpc_node_binary_host_mirror=https://your-url.com

Or defining grpc_node_binary_host_mirror in your .npmrc.

API DOCUMENTATION

See the API Documentation.

TESTING

To run the test suite, simply run npm test in the install location.