All Projects → bruceadams → yj

bruceadams / yj

Licence: Apache-2.0 License
Command line tool that converts YAML to JSON

Programming Languages

rust
11053 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to yj

K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+669.35%)
Mutual labels:  yaml, command-line-tool
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+579.03%)
Mutual labels:  yaml, command-line-tool
Hugo Elasticsearch
Generate Elasticsearch indexes for Hugo static sites by parsing front matter
Stars: ✭ 19 (-69.35%)
Mutual labels:  yaml, command-line-tool
logya
Logya is a static site generator written in Python designed to be easy to use and flexible.
Stars: ✭ 16 (-74.19%)
Mutual labels:  yaml, command-line-tool
Rq
Record Query - A tool for doing record analysis and transformation
Stars: ✭ 1,808 (+2816.13%)
Mutual labels:  yaml, command-line-tool
doi2bib
📝 Easily convert Digital Object Identifier (DOI) and Uniform Resource Locator (URL) to BibTeX and DOI to plain text.
Stars: ✭ 28 (-54.84%)
Mutual labels:  command-line-tool
python-yamlable
A thin wrapper of PyYaml to convert Python objects to YAML and back
Stars: ✭ 28 (-54.84%)
Mutual labels:  yaml
config-loader
Simple C++ Config Loader Framework(Serialization & Reflection)
Stars: ✭ 87 (+40.32%)
Mutual labels:  yaml
Node-CLI-Tips-Tricks
📟 NodeCLI.com repo with Node.js CLI best practices and production-ready tips & tricks.
Stars: ✭ 132 (+112.9%)
Mutual labels:  command-line-tool
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-77.42%)
Mutual labels:  command-line-tool
Zeiver
A Scraper, Downloader, & Recorder for static open directories.
Stars: ✭ 14 (-77.42%)
Mutual labels:  command-line-tool
electron-open-url
Open URL with Electron window from command line or Node.js program
Stars: ✭ 16 (-74.19%)
Mutual labels:  command-line-tool
starcli
✨ Browse trending GitHub projects from your command line
Stars: ✭ 436 (+603.23%)
Mutual labels:  command-line-tool
gogs-bash
Bash Script for Interacting with the GOGS API
Stars: ✭ 31 (-50%)
Mutual labels:  command-line-tool
jira-cli
🔥 [WIP] Feature-rich interactive Jira command line.
Stars: ✭ 809 (+1204.84%)
Mutual labels:  command-line-tool
editorconfig-cli
📝🔧 initialize .editorconfig in your terminal
Stars: ✭ 26 (-58.06%)
Mutual labels:  command-line-tool
whats
🌐 a terminal translation tool
Stars: ✭ 16 (-74.19%)
Mutual labels:  command-line-tool
gq-gmc-control
Control tool for the GQ GMC Geiger Counters.
Stars: ✭ 34 (-45.16%)
Mutual labels:  command-line-tool
shy
💀 bare-bones ssh launcher
Stars: ✭ 51 (-17.74%)
Mutual labels:  command-line-tool
dahgan
A YAML Parser
Stars: ✭ 14 (-77.42%)
Mutual labels:  yaml

YJ - YAML to JSON

Build Status

Simple command line tool to convert a YAML input file into a JSON output file.

How to, etc.

Built in help

$ yj --help
yj 1.2.0

Command line tool that converts YAML to JSON

USAGE:
    yj [FLAGS] [OPTIONS] [INPUT]

ARGS:
    <INPUT>    Input YAML file name. Defaults to stdin

FLAGS:
    -c, --compact    Use compact formatting for the JSON output
    -h, --help       Print help information
    -j, --json       Parse the input as JSON. For most use cases, this option
                     makes no difference. Valid JSON is valid YAML, so JSON
                     input will (should?) parse correctly even when being
                     handled with the YAML parser. Use this option when you
                     want failure (instead of weird results) when the input is
                     invalid JSON
    -V, --version    Print version information
    -y, --yaml       Format the output as YAML instead of JSON

OPTIONS:
    -o, --output <OUTPUT>    Output file name for the JSON. Defaults to stdout

Installing

Local build and install with cargo:

$ cargo install yj

Prebuilt binaries are available on Github releases for some common platforms.

On macOS, the prebuilt binary can be installed using Homebrew. Unfortunately, Homebrew picked up a different utility with the name yj after I chose that name here. So, a simple brew install yj gets that tool, not this one 😞.

$ brew tap bruceadams/utilities
$ brew install bruceadams/utilities/yj

Alternatively on macOS, you may also install yj using MacPorts:

$ sudo port selfupdate
$ sudo port install yj

Minimal Docker images are available on Docker Hub:

$ docker pull bruceadams/yj

Example runs

$ cat .travis.yml
language: rust
os:
  - linux
  - osx
  - windows
rust:
  - stable
  - beta
  - nightly
matrix:
  allow_failures:
    - rust: nightly
  fast_finish: true
$ yj .travis.yml
{
  "language": "rust",
  "os": [
    "linux",
    "osx",
    "windows"
  ],
  "rust": [
    "stable",
    "beta",
    "nightly"
  ],
  "matrix": {
    "allow_failures": [
      {
        "rust": "nightly"
      }
    ],
    "fast_finish": true
  }
}
$ echo pi: 3.1415926 | yj
{
  "pi": 3.1415926
}
$ echo pi: 3.1415926 | yj -c
{"pi":3.1415926}$

Build

Build it your self with Rust 2018, which needs a recent installation of Rust. Get Rust installed from https://rustup.rs/.

cargo build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].