ibraheemdev / modern-unix

A collection of modern/faster/saner alternatives to common unix commands.
30.44k stars 771 forks source link

Consider adding gdu and gron #140

Open snobb opened 4 months ago

snobb commented 4 months ago

Please consider adding the following:

$ echo '{"foo":{"bar":"baz","foo":[1,2,3,4,5]}}' | gron
json = {};
json.foo = {};
json.foo.bar = "baz";
json.foo.foo = [];
json.foo.foo[0] = 1;
json.foo.foo[1] = 2;
json.foo.foo[2] = 3;
json.foo.foo[3] = 4;
json.foo.foo[4] = 5;

Transformation is reversible:

$ echo '{"foo":{"bar":"baz","foo":[1,2,3,4,5]}}' | gron | grep baz | gron -u
{
  "foo": {
    "bar": "baz"
  }
}