-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathndjson.node_cli.txt
22 lines (17 loc) · 1.23 KB
/
ndjson.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
┏━━━━━━━━━━━━┓
┃ NDJSON ┃
┗━━━━━━━━━━━━┛
VERSION ==> #1.5.0
NDJSON.stringify([OPTS])->IOSTREAM#Returns a IOSTREAM that transform input OBJ_ARR into ndjson STR
#Uses JSON-STRINGIFY-SAFE() on each OBJ
#Newline is OS.EOL, i.e. LF or CRLF
#As opposed to spec, values can contain CR
#OPTS are options passed to THROUGH2
NDJSON.parse([OPTS])->IOSTREAM #Returns a IOSTREAM that transform input ndjson STR into OBJ_ARR
#Uses JSON.parse() on each STR line
#OPTS are options passed to THROUGH2
#Can use OPTS.strict true (def):
# - stops streaming by emitting 'error' if JSON.parse() throws
#Ignores empty lines
ndjson [FILE] [--OPT] #CLI. Uses NDJSON.parse(OPTS) on input, NDJSON.stringify(OPTS) on output
#Def FILE: stdin