-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·23 lines (21 loc) · 741 Bytes
/
index.js
File metadata and controls
executable file
·23 lines (21 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env node
const isOldEnough = require('./eol-versions')
const ascii = require('./ascii')
// To guarantee support on older versions and do not drastically impact
// the maintenance of this module, we check if process.version is too old
// and throw EOL warning when true.
if (isOldEnough(process.version)) {
console.log(ascii.danger)
const msg = process.version + ' is end-of-life. There are high chances of being vulnerable. Please upgrade it.'
console.log(msg)
process.exit(1)
} else {
// CLI
if (require.main === module) {
require('./is-vulnerable').cli(process.version, require('os').platform())
} else {
module.exports = {
isNodeVulnerable: require('./is-vulnerable').isNodeVulnerable
}
}
}