Sign inSign up

t13a/yaml2yaml

By t13a

Updated over 7 years ago

A pretty YAML formatter using go-yaml

Image
0

3.1K

t13a/yaml2yaml repository overview

Yaml2yaml

A pretty YAML formatter using go-yaml.

Getting started

You can build from the source, but the fastest way is to run the Docker container. The following is an example of formatting YAML containing a multi-line string. You can see that the quotes and the escape sequences has been removed and the string is comfortably formatted.

$ echo 'say: "hello\\nworld!"' | docker run --rm -i t13a/yaml2yaml
say: |-
  hello
  world!

Of course, it can be also used as JSON to YAML converter.

$ echo '{"say": "hello\\nworld!"}' | docker run --rm -i t13a/yaml2yaml
say: |-
  hello
  world!

In addition, you can output in JSON format by specifying -json-output flag.

$ echo 'say: "hello\\nworld!"' | docker run --rm -i t13a/yaml2yaml -json-output
{
  "say": "hello\nworld!"
}

What was 2yaml? Let's not care about such a small thing.

Tag summary

Content type

Image

Digest

Size

4.2 MB

Last updated

over 7 years ago

docker pull t13a/yaml2yaml