LinuxCommandLibrary

json5

json5

TLDR

Convert JSON5 stdin to JSON stdout

$ echo [input] | json5
copy


Convert a JSON5 file to JSON and output to stdout
$ json5 [path/to/input_file.json5]
copy


Convert a JSON5 file to the specified JSON file
$ json5 [path/to/input_file.json5] --out-file [path/to/output_file.json]
copy


Validate a JSON5 file
$ json5 [path/to/input_file.json5] --validate
copy


Specify the number of spaces to indent by (or "t" for tabs)
$ json5 --space [indent_amount]
copy


View available options
$ json5 --help
copy

DESCRIPTION

Usage: json5 [options] <file>

If <file> is not provided, then STDIN is used.

Options:

-s, --space

The number of spaces to indent or 't' for tabs

-o, --out-file [file]

Output to the specified file, otherwise STDOUT

-v, --validate

Validate JSON5 but do not output JSON

-V, --version

Output the version number

-h, --help

Output usage information

Copied to clipboard