2025-03-14 21:59:59 -06:00
|
|
|
# json5
|
|
|
|
|
|
|
|
|
|
> Convert JSON5 files to JSON.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://json5.org/#cli>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Convert JSON5 `stdin` to JSON `stdout`:
|
|
|
|
|
|
|
|
|
|
`echo {{input}} | json5`
|
|
|
|
|
|
|
|
|
|
- Convert a JSON5 file to JSON and output to `stdout`:
|
|
|
|
|
|
|
|
|
|
`json5 {{path/to/input_file.json5}}`
|
|
|
|
|
|
|
|
|
|
- Convert a JSON5 file to the specified JSON file:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`json5 {{path/to/input_file.json5}} {{[-o|--out-file]}} {{path/to/output_file.json}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Validate a JSON5 file:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`json5 {{path/to/input_file.json5}} {{[-v|--validate]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Specify the number of spaces to indent by (or "t" for tabs):
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`json5 {{[-s|--space]}} {{indent_amount}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`json5 {{[-h|--help]}}`
|