From 69d4377dc23814187afb5ecac184831e95b43dc5 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 31 May 2019 16:03:59 -0400 Subject: [PATCH] grpc-js: load semver range from package.json This commit loads the required semver range from the package.json file, instead of hard-coding the string in index.ts. --- packages/grpc-js/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-js/src/index.ts b/packages/grpc-js/src/index.ts index d54c0a67..e49cfb5d 100644 --- a/packages/grpc-js/src/index.ts +++ b/packages/grpc-js/src/index.ts @@ -41,7 +41,7 @@ import { Metadata } from './metadata'; import { KeyCertPair, ServerCredentials } from './server-credentials'; import { StatusBuilder } from './status-builder'; -const supportedNodeVersions = '^8.13.0 || >=10.10.0'; +const supportedNodeVersions = require('../../package.json').engines.node; if (!semver.satisfies(process.version, supportedNodeVersions)) { throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`); }