{
    "mode": "man",
    "parameter": "json5",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/json5/1/json",
    "generated": "2026-07-05T13:01:50Z",
    "sections": {
        "NAME": {
            "content": "cli.js - Command line for the JSON5 Data Interchange Format (JSON5)\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Usage: json5 [options] <file>\n\nIf <file> is not provided, then STDIN is used.\n\nOptions:\n",
            "subsections": [
                {
                    "name": "-s --space",
                    "content": "The number of spaces to indent or 't' for tabs\n",
                    "flag": "-s",
                    "long": "--space"
                },
                {
                    "name": "-o --out-file",
                    "content": "Output to the specified file, otherwise STDOUT\n",
                    "flag": "-o",
                    "long": "--out-file"
                },
                {
                    "name": "-v --validate",
                    "content": "Validate JSON5 but do not output JSON\n",
                    "flag": "-v",
                    "long": "--validate"
                },
                {
                    "name": "-V --version",
                    "content": "Output the version number\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Output usage information\n\n\n\ncli.js 2.2.0                                November 2021                                  CLI.JS(1)",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        }
    },
    "summary": "cli.js - Command line for the JSON5 Data Interchange Format (JSON5)",
    "flags": [
        {
            "flag": "-s",
            "long": "--space",
            "arg": null,
            "description": "The number of spaces to indent or 't' for tabs"
        },
        {
            "flag": "-o",
            "long": "--out-file",
            "arg": null,
            "description": "Output to the specified file, otherwise STDOUT"
        },
        {
            "flag": "-v",
            "long": "--validate",
            "arg": null,
            "description": "Validate JSON5 but do not output JSON"
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Output the version number"
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Output usage information cli.js 2.2.0 November 2021 CLI.JS(1)"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Convert JSON5 files to JSON.",
        "examples": [
            {
                "description": "Convert JSON5 `stdin` to JSON `stdout`",
                "command": "echo {{input}} | json5"
            },
            {
                "description": "Convert a JSON5 file to JSON and output to `stdout`",
                "command": "json5 {{path/to/input_file.json5}}"
            },
            {
                "description": "Convert a JSON5 file to the specified JSON file",
                "command": "json5 {{path/to/input_file.json5}} {{-o|--out-file}} {{path/to/output_file.json}}"
            },
            {
                "description": "Validate a JSON5 file",
                "command": "json5 {{path/to/input_file.json5}} {{-v|--validate}}"
            },
            {
                "description": "Specify the number of spaces to indent by (or \"t\" for tabs)",
                "command": "json5 {{-s|--space}} {{indent_amount}}"
            },
            {
                "description": "Display help",
                "command": "json5 {{-h|--help}}"
            }
        ]
    }
}