-
Notifications
You must be signed in to change notification settings - Fork 16
/
prettyjson.node_cli.txt
40 lines (33 loc) · 3.04 KB
/
prettyjson.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
PRETTYJSON
VERSION ==> #1.2.1
#Like JSON.stringify() but with colors, and YAML style
#Also aligns OBJ values, and prints FUNC|ERROR
PRETTYJSON.render #OPTS:
(VAL[, OPTS][, NUM])->STR # - noColor BOOL (def: false)
#NUM is indentation size (def: 2) (can also use OPTS.defaultIndentation NUM)
#How each type is beautified:
# - STR:
# - multiline: """ ... """ (YAML-style)
# - uses OPTS.stringColor 'COLOR' (def: '')
# - NUM:
# - uses OPTS.numberColor 'COLOR' (def: 'blue')
# - BOOL:
# - green for true, red for false
# - null: grey
# - ARR:
# - either:
# - on several lines (YAML-style)
# - inline, if OPTS.inlineArrays true. Uses OPTS.dashColor 'COLOR' (def: 'green')
# - if empty, OPTS.emptyArrayMsg STR (def: '(empty array)')
# - OBJ:
# - no braces (YAML-style)
# - vertically align keys, but also values unless OPTS.noAlign true (def: false)
# - uses OPTS.keysColors 'COLOR' (def: 'green')
#Specific types, non JSON (not with CLI):
# - undefined: skipped
# - any FUNC is always rendered as 'function() {}'
# - ERROR: { message, stack }
prettyjson [--OPT] [FILE] #CLI
#Def FILE: stdin