grpc-lite
v2016.12.3
Published
this zero-dependency package will download and install the grpc-v1.0.1 prebuilt-binary from https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc
Downloads
8
Maintainers
Readme
grpc-lite
this zero-dependency package will download and install the grpc-v1.0.1 prebuilt-binary from https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc
documentation
api-doc
todo
- upgrade to grpc v1.1.x when stable
- none
change since 6f1f48ac
- npm publish 2016.12.3
- update documentation
- none
this package requires
- darwin or linux os
- node (version v4.x to v6.x)
additional info
- current node-grpc implementation (which this package is based) does not support node v7.0.0 or higher (https://github.com/grpc/grpc/issues/8649)
- includes external busybox binary from https://busybox.net/downloads/binaries/1.21.1/busybox-i486
build-status
| git-branch : | master | beta | alpha| |--:|:--|:--|:--| | test-report : | | | | | coverage : | | | | | build-artifacts : | | | |
master branch
- stable branch
- HEAD should be tagged, npm-published package
beta branch
- semi-stable branch
- HEAD should be latest, npm-published package
alpha branch
- unstable branch
- HEAD is arbitrary
- commit history may be rewritten
package.json
{
"package.json": true,
"author": "kai zhu <[email protected]>",
"description": "{{packageJson.description}}",
"devDependencies": {
"electron-lite": "kaizhu256/node-electron-lite#alpha",
"utility2": "kaizhu256/node-utility2#alpha"
},
"engines": { "node": ">=4 <7" },
"keywords": [
"api",
"grpc",
"light", "lightweight", "lite",
"protobuf"
],
"license": "MIT",
"main": "lib.grpc",
"name": "grpc-lite",
"os": ["darwin", "linux"],
"repository": {
"type": "git",
"url": "https://github.com/kaizhu256/node-grpc-lite.git"
},
"scripts": {
"build-ci": "utility2 shRun shReadmeBuild",
"postinstall": "./lib.grpc.sh shNpmPostinstall",
"test": "\
rm -fr external /tmp/grpc_node-* && \
npm run postinstall && \
export PORT=$(utility2 shServerPortRandom) && utility2 test test.js"
},
"version": "2016.12.3"
}
changelog of last 50 commits
internal build-script
- build.sh
# build.sh
# this shell script will run the build for this package
shBuildCiTestPre() {(set -e
# this function will run the pre-test build
# test published-package
(export MODE_BUILD=npmTestPublished &&
shRunScreenCapture shNpmTestPublished) || return $?
return
)}
shBuild() {(set -e
# this function will run the main build
# init env
. node_modules/.bin/utility2 && shInit
# cleanup github-gh-pages dir
# export BUILD_GITHUB_UPLOAD_PRE_SH="rm -fr build"
# init github-gh-pages commit-limit
export COMMIT_LIMIT=16
# if branch is alpha, beta, or master, then run default build
if [ "$CI_BRANCH" = alpha ] ||
[ "$CI_BRANCH" = beta ] ||
[ "$CI_BRANCH" = master ]
then
shBuildCiDefault
# upload build-artifacts to github, and if number of commits > $COMMIT_LIMIT,
# then squash older commits
(export MODE_BUILD=buildGithubUpload &&
shBuildGithubUpload) || return $?
fi
)}
shBuild
original README.md
Node.js gRPC Library
PREREQUISITES
node
: This requiresnode
to be installed, version0.12
or above. If you instead have thenodejs
executable on Debian, you should install thenodejs-legacy
package.Note: If you installed
node
via a package manager and the version is still less than0.12
, try directly installing it from nodejs.org.
INSTALLATION
Install the gRPC NPM package
npm install grpc
BUILD FROM SOURCE
- Clone the grpc Git Repository.
- Run
npm install
from the repository root.
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 retrynpm 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.