Merge pull request #523 from murgatroid99/pure_js_engines_check

Pure js: fix engines field, add runtime check
This commit is contained in:
Michael Lumish 2018-09-04 10:48:26 -07:00 committed by GitHub
commit 74bcdb62cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,7 @@
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js-core",
"main": "build/src/index.js",
"engines": {
"node": ">=8.4"
"node": "^8.11.2 || >=9.4"
},
"keywords": [],
"author": {
@ -20,6 +20,7 @@
"@types/node": "^10.5.4",
"clang-format": "^1.0.55",
"gts": "^0.5.1",
"semver": "^5.5.0",
"typescript": "~2.7.0"
},
"contributors": [

View File

@ -9,6 +9,12 @@ import {loadPackageDefinition, makeClientConstructor} from './make-client';
import {Metadata} from './metadata';
import { Channel } from './channel';
import * as logging from './logging';
import * as semver from 'semver';
const supportedNodeVersions = '^8.11.2 || >=9.4';
if (!semver.satisfies(process.version, supportedNodeVersions)) {
throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
}
interface IndexedObject {
[key: string]: any;