-
Notifications
You must be signed in to change notification settings - Fork 16
/
chalk.node_cli.txt
79 lines (68 loc) · 5.16 KB
/
chalk.node_cli.txt
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
CHALK
ALTERNATIVES ==> # - chalk (preferred)
# - 8|24-bits colors
# - good colors detection
# - yoctocolors (preferred if need small)
# - no 8|24-bits colors
# - good color detection
# - does not support nested ANSI sequences well
# - util.styleText() (preferred if need small and no color detection)
# - no 8|24-bits colors
# - no color detection
# - does not support nested ANSI sequences well
# - kleur:
# - no *Bright, overline nor 8|24-bits colors
# - much poorer colors detection
# - does not support nested ANSI sequences well
# - ansi-colors:
# - no overline nor 8|24-bits colors
# - much poorer colors detection
# - colors.js:
# - not well maintained
# - no overline nor 8|24-bits colors
# - good colors detection
# - theming
# - colorette:
# - no overline nor 8|24-bits colors
# - much poorer colors detection
# - Deno setColors (preferred with Deno):
# - Deno core
# - 8|24-bits colors
# - no overline
# - colors detection only based on ENVVAR NO_COLOR
VERSION ==> #5.3.0
new Chalk([OPTS]) #STYLES
CHALK|chalkStderr #Singleton STYLES with default OPTS
STYLES.STYLE...(STR...)->STR #Wrap STR with ANSI sequences for colors|style
STYLES.STYLE...`...` #STYLE can be any MODIFIER|[bg]COLOR from ANSI-STYLES (see its doc):
# - reset|bold|underline|inverse
# - (not supported on Windows terminal) dim|italic|hidden|strikethrough|overline
# - visible: hidden if 1-bit colors
# - [bg]black|red|green|yellow|blue|magenta|cyan|white|gray[Bright]
# - [bg]rgb|hex|ansi256(...)
#If several STR, join with spaces.
STYLES|OPTS.level #Can be:
# - 0: no ANSI sequences
# - 1: turn 8|24-bits colors to 4 bits
# - 2: turn 24-bits colors to 8 bits
# - 3
#Def: based on SUPPORTS-COLOR.stdout
supportsColor[Stderr] #SUPPORTS-COLOR.stdout|stderr (see its doc)
modifierNames #'MODIFIER'_ARR
[background|foreground]ColorNames #'COLOR'_ARR
chalk-template ##Version 1.1.0
template[Stderr]
('... {STYLE... STR} ...')
chalkTemplate[Stderr] ##Same as `... ${STYLES.STYLE...(STR)} ...`
`... {STYLE... ${STR}} ...` ##Spaces inside STYLE are not allowed, e.g. rgb(0,0,0), not rgb(0, 0, 0)
makeTemplate(CHALK)->template
makeTaggedTemplate(CHALK)
->chalkTemplate ##Same with custom CHALK
chalk STYLE... STR ##Same but as CLI
##Package chalk-cli (5.0.1)
--template|-t STR ##Using syntax '{[~]STYLE... STR}'
--stdin ##Allow using stdin
--no-newline|-n ##No newline at end
--demo ##Show all possible styles