tldr/pages/common/json5.md

29 lines
581 B
Markdown
Raw Normal View History

2018-03-12 18:53:35 +00:00
# json5
> Convert JSON5 files to JSON.
2019-06-05 08:55:43 +01:00
> More information: <https://json5.org>.
2018-03-12 18:53:35 +00:00
- Convert JSON5 `stdin` to JSON `stdout`:
2018-03-12 18:53:35 +00:00
`echo {{input}} | json5`
- Convert a JSON5 file to JSON and output to `stdout`:
2018-03-12 18:53:35 +00:00
`json5 {{path/to/input_file.json5}}`
- Convert a JSON5 file to the specified JSON file:
`json5 {{path/to/input_file.json5}} --out-file {{path/to/output_file.json}}`
- Validate a JSON5 file:
`json5 {{path/to/input_file.json5}} --validate`
- Specify the number of spaces to indent by (or "t" for tabs):
`json5 --space {{indent_amount}}`
- Display help:
2018-03-12 18:53:35 +00:00
`json5 --help`