Skip to content

edast/flatten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Utility to flatten json into key = value pairs. It might be used to compare different json objects.

It accepts json as first cli attribute, or can read from stdin:

❯ echo '{"foo":"bar","baz":{"bar":1}}' | ./flatten
foo = bar
baz.bar = 1

Run go build -o flatten main.go to build binary.

For array values in json - multiple lines with the same key will be printed:

echo '{"foo":"bar","baz":{"bar":[1,2,3,4,5]}}' | flatten
foo = bar
baz.bar = 1
baz.bar = 2
baz.bar = 3
baz.bar = 4
baz.bar = 5

About

JSON flatten utility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages