[Backport 7.x] Add warning log about nodejs version support (#1350)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
94e8bcd611
commit
3cb336be67
18
index.js
18
index.js
@ -41,6 +41,24 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
|
|||||||
|
|
||||||
const ESAPI = require('./api')
|
const ESAPI = require('./api')
|
||||||
|
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (nodeMajor < 10) {
|
||||||
|
process.emitWarning('You are using a version of Node.js that is currently in EOL. ' +
|
||||||
|
'The support for this version will be dropped in 7.12. ' +
|
||||||
|
'Please refer to https://ela.st/nodejs-support for additional information.',
|
||||||
|
'DeprecationWarning'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (nodeMajor >= 10 && nodeMajor < 12) {
|
||||||
|
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
|
||||||
|
'The support for this version will be dropped in 7.13. ' +
|
||||||
|
'Please refer to https://ela.st/nodejs-support for additional information.',
|
||||||
|
'DeprecationWarning'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
class Client extends ESAPI {
|
class Client extends ESAPI {
|
||||||
constructor (opts = {}) {
|
constructor (opts = {}) {
|
||||||
super({ ConfigurationError })
|
super({ ConfigurationError })
|
||||||
|
|||||||
Reference in New Issue
Block a user