Skip to content

A pretty YAML formatter using go-yaml

License

Notifications You must be signed in to change notification settings

Danny5487401/yaml2yaml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A pretty YAML formatter using go-yaml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.1%
  • Dockerfile 3.9%