brancz/gojsontoyaml

Simple tool to convert json to yaml written in Go.

85

stars

23

commits

Go

primary language

Apr 16, 2024

updated

README

gojsontoyaml

This is a small tool written in go to convert json to yaml reading from STDIN and writing to STDOUT. The heavy lifting is actually done by ghodss/yaml and gopkg.in/yaml.v2.

Install

To install simply

go install github.com/brancz/gojsontoyaml@latest

Usage

Simply pipe a json string into gojsontoyaml and it will print the converted yaml string to STDOUT.

$ echo '{"test":"test string with\\nmultiple lines"}' | gojsontoyaml
test: |-
  test string with
  multiple lines

Motivation

You may ask yourself why this was developed. The answer is simple, when I wrote this there was no simple to use binary for this purpose that supported yaml multiline strings. All alternatives out there that I tried kept line breaks in the string rather than making use of the yaml multiline strings.

Contributors

brancz

10 commits

bearice

6 commits

maikelvl

2 commits

kouk

1 commits

brancz/gojsontoyaml

Simple tool to convert json to yaml written in Go.

85

stars

23

commits

Go

primary language

Apr 16, 2024

updated

README

gojsontoyaml

This is a small tool written in go to convert json to yaml reading from STDIN and writing to STDOUT. The heavy lifting is actually done by ghodss/yaml and gopkg.in/yaml.v2.

Install

To install simply

go install github.com/brancz/gojsontoyaml@latest

Usage

Simply pipe a json string into gojsontoyaml and it will print the converted yaml string to STDOUT.

$ echo '{"test":"test string with\\nmultiple lines"}' | gojsontoyaml
test: |-
  test string with
  multiple lines

Motivation

You may ask yourself why this was developed. The answer is simple, when I wrote this there was no simple to use binary for this purpose that supported yaml multiline strings. All alternatives out there that I tried kept line breaks in the string rather than making use of the yaml multiline strings.

Contributors

brancz

10 commits

bearice

6 commits

maikelvl

2 commits

kouk

1 commits

Languages

Go

100.0%