1. 29
  1.  

  2. 9

    Also I’ve created tool called eat, which can “eat” everything including json, yaml, toml, xml, ini and output JSON for next processing with fx

    Is this a TOML document with a single empty table, or a JSON document with an array with one item?

    [null]
    
    1. 7

      Mu!

      1. 3

        So… how does Eat handle it?

        1. 4

          JSON. It first attempts to decode as JSON, then XML, then YAML, then TOML, then INI.

    2. 6

      jo is pretty rad, too. It handles creation of JSON much easier than jq.

      1. 2

        The problem is jq is becoming a standard and working its way into a bunch of mainline scripts. I wish someone would write a book on it. I can do simple queries but find some of the syntaxes to be impenetrable.

          1. 1

            Linking to the manual isn’t really helpful. Do you have other more insightful resources to offer?

            1. 1

              None. But I found the manual to be excellent. There’s even examples for almost everything.

        1. 1

          Do you have any recommendations to do the reverse?

          1. 8

            You want to destroy JSON?

            1. 1

              This comment mentions gron.

          2. 4

            I’ve found that gron (https://github.com/tomnomnom/gron) is incredibly useful for gluing things to json in shell scripts.