-
Notifications
You must be signed in to change notification settings - Fork 8
/
ascii.js
45 lines (38 loc) · 2.07 KB
/
ascii.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const util = require('util')
const danger = '\n' +
'\n' +
'██████ █████ ███ ██ ██████ ███████ ███████\n' +
'██ ██ ██ ██ ████ ██ ██ ██ ██ ██\n' +
'██ ██ ███████ ██ ██ ██ ██ ███ █████ ███████\n' +
'██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██\n' +
'██████ ██ ██ ██ ████ ██████ ███████ ██ ██\n' +
'\n'
const allGood = '\n' +
'\n' +
' █████ ██ ██ ██████ ██████ ██████ ██████ ██\n' +
'██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██\n' +
'███████ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██\n' +
'██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██\n' +
'██ ██ ███████ ███████ ██████ ██████ ██████ ██████ ██\n' +
'\n'
function escapeStyleCode (code) {
return '\u001b[' + code + 'm'
}
function bold (text) {
var left = ''
var right = ''
const formatCodes = util.inspect.colors.bold
left += escapeStyleCode(formatCodes[0])
right = escapeStyleCode(formatCodes[1]) + right
return left + text + right
}
const vulnerableWarning = bold('The current Node.js version (' + process.version + ') is vulnerable to the following CVEs:')
var separator = '='
for (var i = 0; i < process.stdout.columns; ++i) {
separator = separator + '='
}
module.exports.danger = danger
module.exports.allGood = allGood
module.exports.bold = bold
module.exports.vulnerableWarning = vulnerableWarning
module.exports.separator = separator