-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
96 lines (80 loc) · 3.12 KB
/
cli.js
File metadata and controls
96 lines (80 loc) · 3.12 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import c from './index.js';
console.log('--- Basic Colors ---')
console.log(c.black('black'))
console.log(c.red('red'))
console.log(c.green('green'))
console.log(c.yellow('yellow'))
console.log(c.blue('blue'))
console.log(c.magenta('magenta'))
console.log(c.cyan('cyan'))
console.log(c.white('white'))
console.log(c.gray('gray'))
console.log('\n--- Bright Colors ---')
console.log(c.blackBright('blackBright'))
console.log(c.redBright('redBright'))
console.log(c.bold.italic.greenBright('greenBright'))
console.log(c.yellowBright('yellowBright'))
console.log(c.blueBright('blueBright'))
console.log(c.magentaBright('magentaBright'))
console.log(c.cyanBright('cyanBright'))
console.log(c.whiteBright('whiteBright'))
console.log('\n--- Background Colors ---')
console.log(c.bgBlack('bgBlack'))
console.log(c.bgRed('bgRed'))
console.log(c.bgGreen('bgGreen'))
console.log(c.bgYellow('bgYellow'))
console.log(c.bgBlue('bgBlue'))
console.log(c.bgMagenta('bgMagenta'))
console.log(c.bgCyan('bgCyan'))
console.log(c.bgWhite('bgWhite'))
console.log('\n--- Bright Backgrounds ---')
console.log(c.bgBlackBright('bgBlackBright'))
console.log(c.bgRedBright('bgRedBright'))
console.log(c.bgGreenBright('bgGreenBright'))
console.log(c.bgYellowBright('bgYellowBright'))
console.log(c.bgBlueBright('bgBlueBright'))
console.log(c.bgMagentaBright('bgMagentaBright'))
console.log(c.bgCyanBright('bgCyanBright'))
console.log(c.bgWhiteBright('bgWhiteBright'))
console.log('\n--- Styles ---')
console.log(c.reset('reset'))
console.log(c.bold('bold'))
console.log(c.dim('dim'))
console.log(c.italic('italic'))
console.log(c.underline('underline'))
console.log(c.inverse('inverse'))
console.log(c.hidden('hidden'))
console.log(c.strikethrough('strikethrough'))
console.log('\n--- Chaining ---')
console.log(c.bold.red('bold red'))
console.log(c.bold.red.underline('bold red underline'))
console.log(c.italic.cyan('italic cyan'))
console.log(c.dim.yellow.bgBlue('dim yellow on blue'))
console.log(c.inverse.white('inverse white'))
console.log('\n--- RGB ---')
console.log(c.rgb(255, 100, 50)('orange'))
console.log(c.rgb(100, 255, 150).bold('mint bold'))
console.log(c.bgRgb(30, 30, 80).white('dark blue bg'))
console.log('\n--- HEX ---')
console.log(c.hex('#ff6347')('tomato'))
console.log(c.hex('#00d4aa').bold('teal bold'))
console.log(c.bgHex('#1e1e3f').white('dark bg'))
console.log('\n--- 256 Color ---')
console.log(c.ansi256(201)('pink'))
console.log(c.bgAnsi256(52).white('dark red bg'))
console.log('\n--- Nested Styles ---')
console.log(c.bold(`bold and ${c.red('red inside')} back to bold`))
console.log(c.red(`red and ${c.bold('bold inside')} back to red`))
console.log(c.underline(`underline ${c.italic('italic inside')} underline`))
console.log('\n--- Check Support ---')
console.log('Color supported:', c.isColorSupported)
const log = {
info: msg => console.log(c.blue('[INFO]'), msg),
warn: msg => console.log(c.yellow('[WARN]'), msg),
error: msg => console.log(c.bold.red('[ERROR]'), msg),
success: msg => console.log(c.green('✓'), c.bold(msg))
}
log.info('Server starting...')
log.success('Server ready on port 3000')
log.warn('Deprecated API used')
log.error('Connection failed')