Skip to content

LJTian/j2y

Repository files navigation

j2y (JSON to YAML)

Release License Build Status

j2y is a lightweight, zero-dependency command-line tool that converts JSON to YAML.

It is designed to be pipe-friendly, making it a perfect companion for kubectl, docker, and other DevOps tools.

Install

Option 1: One-line Installer (Recommended)

Install the latest version directly from your terminal:

curl -sfL https://raw.githubusercontent.com/LJTian/j2y/main/install.sh | bash

Option 2: Source Installer

Build and install from source code: Install the latest version directly from your terminal:

git clone https://github.com/LJTian/j2y.git
cd j2y
make install

Use

j2y (json to yaml) is a tool for converting JSON data (from files or direct input) to YAML format.

Examples:
1.Convert from file: 
    j2y -f input.json -o output.yaml
2.Convert from command line JSON data: 
    j2y -i '{"key": "value"}' -o output.yaml
3.Convert from standard input: 
    echo '{"foo":1}' | j2y
4.Specify input file only, output to stdout: 
    j2y -f input.json
5.Specify JSON data only, output to stdout: 
    j2y -i '{"key": "value"}'

Usage:
  Usage: j2y [-f inputFile | -i jsonData] [output] [flags]

Flags:
  -f, --file string     Input JSON file path
  -h, --help            help for Usage:
  -i, --input string    Input JSON data
  -o, --output string   Output YAML file (optional)

Use libraries

Set the help language

Controlled by the environment variable J2Y_LANG. If not set, LANG is used. If no corresponding language is found, en is used.

About

json to yaml tool。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •