jsoncdetox

command module
v0.0.0-...-ec3c409 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README

jsoncdetox

NAME

jsoncdetox - Convert JSONC into JSON

SYNOPSIS

jsoncdetox [ -i input_file ] [ -o output_file ] [ -m ]

DESCRIPTION

'jsoncdetox' converts JSON with Comments into valid JSON by removing comments, trailing commas.

OPTIONS

-i, --input

Read from the given file path, If omitted, read from stdin.

-o, --output

Write output to the given file path, If omitted, write to stdout.

-m, --minify

Output minified JSON instead of pretty-print.

EXAMPLE

$ cat sample.jsonc
{
  "foo": "bar", // foobar
  /*         _                           __     __
   *        (_)________  ____  _________/ /__  / /_____  _  __
   *       / / ___/ __ \/ __ \/ ___/ __  / _ \/ __/ __ \| |/_/
   *      / (__  ) /_/ / / / / /__/ /_/ /  __/ /_/ /_/ />  <
   *   __/ /____/\____/_/ /_/\___/\__,_/\___/\__/\____/_/|_|
   *  /___/
   */
  "baz": {
   "qux": 1,
   "quux": 2,
   "quuux": 3,
   "quuuux": 4,
   "quuuuux": 5,
   "quuuuuux": 6,
  },
  "corge": [1, 2, 3, 4, 5, 6],
}

$ jsoncdetox -i sample.jsonc
{
  "foo": "bar",
  "baz": {
    "qux": 1,
    "quux": 2,
    "quuux": 3,
    "quuuux": 4,
    "quuuuux": 5,
    "quuuuuux": 6
  },
  "corge": [
    1,
    2,
    3,
    4,
    5,
    6
  ]
}

RUN DIRECTLY

go run github.com/drillbits/jsoncdetox@latest

INSTALLATION

go install github.com/drillbits/jsoncdetox@latest

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL