Search in newline delimited JSON files.
npm install -g ndjson-search
ndjs <filepath> [...options]
ndjs ./file.ndsjon --field name --value "John Doe"
ndjs ./file.ndsjon --field name --pattern "^John.+Doe$"
ndjs ./file.ndsjon --field payload.user.id --value 123
ndjs ./file.ndsjon --field payload.user.id --value 123 > result.ndjson
ndjs ./file.ndsjon --field payload.user.id --value 123 --output json
ndjs ./file.ndsjon --field payload.user.id --value 123 --indent 2 --colors
ndjs <input>
Search the ndjson
Positionals:
input The input file path [string]
Options:
--version Show version number [boolean]
--help Show help [boolean]
--indent, -i Spaces of indentation for the json, if not provided no
indentation is applied. [number]
--field, -f Field/path to match on (no field will return everything)
[string]
--pattern, -p RegEx pattern to match the field on [string]
--value, -v Exact value to match the field on [string]
--limit, -l Maximum amount of items the retrieve [number]
--output, -o Search result output format
[string] [choices: "ndjson", "json", "count"] [default: "ndjson"]
--colors, -c Syntax highlight the json/ndjson output
[boolean] [default: false]