gRPC for Node.js
Go to file
Julien Boeuf b6d16885ef Also adding a credentials type to the plugin API.
The purpose of this is to be able to install a composition policy that
describes which types are incompatible and that will be enforced during
call creds composition.

If this functionality is wanted it will be done in an additive function in
the API like :

void grpc_call_credentials_set_composite_policy(
  grpc_call_credentials_composite_policy policy);
2015-11-19 22:00:30 -08:00
ext Also adding a credentials type to the plugin API. 2015-11-19 22:00:30 -08:00
health_check Update node health check service 2015-08-21 10:43:02 -07:00
interop Make Node interop client use default roots file path 2015-10-22 09:47:30 -07:00
performance Resolved merge conflicts 2015-10-07 13:53:58 -07:00
src Ensure application and Node library user agent strings are together at the beginning 2015-11-06 10:25:06 -08:00
test Merge branch 'master' of github.com:grpc/grpc into core_creds_api_change 2015-11-17 20:55:13 -08:00
.gitignore Prepare for the new batch call API. 2015-02-02 10:16:30 -08:00
.jshintrc Fixed lint errors 2015-02-19 14:37:18 -08:00
README.md Add npm badge 2015-10-30 08:47:52 -07:00
index.js Distribute roots.pem with the Node package 2015-10-15 09:57:31 -07:00
jsdoc_conf.json Added documentation command and settings to Node package 2015-07-24 14:23:44 -07:00

README.md

npm

Node.js gRPC Library

Status

Beta

PREREQUISITES

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

INSTALLATION

Install the gRPC NPM package

npm install grpc

BUILD FROM SOURCE

  1. Clone the grpc Git Repository.
  2. Run npm install.

TESTING

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

API

This library internally uses ProtoBuf.js, and some structures it exports match those exported by that library

If you require this module, you will get an object with the following members

function load(filename)

Takes a filename of a Protocol Buffer file, and returns an object representing the structure of the protocol buffer in the following way:

  • Namespaces become maps from the names of their direct members to those member objects
  • Service definitions become client constructors for clients for that service. They also have a service member that can be used for constructing servers.
  • Message definitions become Message constructors like those that ProtoBuf.js would create
  • Enum definitions become Enum objects like those that ProtoBuf.js would create
  • Anything else becomes the relevant reflection object that ProtoBuf.js would create
function loadObject(reflectionObject)

Returns the same structure that load returns, but takes a reflection object from ProtoBuf.js instead of a file name.

function Server([serverOpions])

Constructs a server to which service/implementation pairs can be added.

status

An object mapping status names to status code numbers.

callError

An object mapping call error names to codes. This is primarily useful for tracking down certain kinds of internal errors.

Credentials

An object with factory methods for creating credential objects for clients.

ServerCredentials

An object with factory methods for creating credential objects for servers.