yj

command module
Version: v0.0.0-...-737bdf4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

yj

Build Status GoDoc

Convert between YAML, TOML, JSON, and HCL.

Preserves map order.

Format versions:

  • YAML: v1.2 (gopkg.in/yaml.v3)
  • TOML: v1.0.0-rc.3 (github.com/pelletier/go-toml)
  • JSON: RFC 7159 (encoding/json)
  • HCL: v1 (github.com/hashicorp/hcl)
opal:yj stephen$ yj -h
Usage: yj [-][ytjcrneikhv]

Convert between YAML, TOML, JSON, and HCL.
Preserves map order.

-x[x]  Convert using stdin. Valid options:
          -yj, -y = YAML to JSON (default)
          -yy     = YAML to YAML
          -yt     = YAML to TOML
          -yc     = YAML to HCL
          -tj, -t = TOML to JSON
          -ty     = TOML to YAML
          -tt     = TOML to TOML
          -tc     = TOML to HCL
          -jj     = JSON to JSON
          -jy, -r = JSON to YAML
          -jt     = JSON to TOML
          -jc     = JSON to HCL
          -cy     = HCL to YAML
          -ct     = HCL to TOML
          -cj, -c = HCL to JSON
          -cc     = HCL to HCL
-n     Do not covert inf, -inf, and NaN to/from strings (YAML or TOML only)
-e     Escape HTML (JSON out only)
-i     Indent output (JSON or TOML out only)
-k     Attempt to parse keys as objects or numbers types (YAML out only)
-h     Show this help message
-v     Show version
Installation

yj is available for macOS via Homebrew:

$ brew install yj

Binaries for macOS, Linux, and Windows are attached to each release.

yj is also available as a Docker image.

Go Package

Packages contained in this repo may also be used to convert all supported data formats to a normalized tree of ordered Go objects. See godoc for details.

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto