Skip to content

Commit 2d51ef4

Browse files
[Backport 7.x] Add warning log about nodejs version support (#1350)
Co-authored-by: Tomas Della Vedova <[email protected]>
1 parent 3978903 commit 2d51ef4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
4141

4242
const ESAPI = require('./api')
4343

44+
/* istanbul ignore next */
45+
if (nodeMajor < 10) {
46+
process.emitWarning('You are using a version of Node.js that is currently in EOL. ' +
47+
'The support for this version will be dropped in 7.12. ' +
48+
'Please refer to https://ela.st/nodejs-support for additional information.',
49+
'DeprecationWarning'
50+
)
51+
}
52+
53+
/* istanbul ignore next */
54+
if (nodeMajor >= 10 && nodeMajor < 12) {
55+
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
56+
'The support for this version will be dropped in 7.13. ' +
57+
'Please refer to https://ela.st/nodejs-support for additional information.',
58+
'DeprecationWarning'
59+
)
60+
}
61+
4462
class Client extends ESAPI {
4563
constructor (opts = {}) {
4664
super({ ConfigurationError })

0 commit comments

Comments
 (0)