[Bend-pm] JSON pretty printing

Josh Lavin pm at jlavin.com
Wed Aug 24 19:20:50 PDT 2016


Wish I could, but I'm out of town.

Josh


On Wed, Aug 24, 2016, at 06:20 PM, Mitch Small wrote:
> Hey, all! Are we on for tomorrow?
>
> On Mon, Aug 22, 2016 at 2:48 PM, Josh Lavin <pm at jlavin.com> wrote:
>> On Mon, Aug 22, 2016, at 11:20 AM, Tim Howe wrote:
>>  > I seem to recall a question about pretty printing JSON when we
>>  > last met, and I had said I had done this.  Apparently I used this:
>>  > https://metacpan.org/pod/JSON
>>  >
>>  >       I have a simple example in my Catalyst version of PieNg:
>>  >       https://github.com/thowe/PieNg/blob/master/lib/PieNg/Controller/Logs.pm#L47
>>
>> Nice, thanks!
>>
>>  I got curious and tried to cook up my own little script to use
>>  to pass
>>  in JSON and pretty-print it back, used like:
>>
>>  echo '{"subtotal":21.40,"quantity":2,"description":"Foo"}' | js
>>
>>  It worked great, but then I wanted colorized output. I found an
>>  existing
>>  CPAN module, App::lj (https://metacpan.org/pod/App::LJ) which
>>  provides
>>  an `lj` script to do that same thing.
>>
>>  It uses JSON::Color. However, JSON::Color won't keep integers, but
>>  instead makes them strings. :-( I filed a bug.
>>
>>  Maybe I'll write my own colorization. For now, here's my script:
>> https://gist.github.com/jdigory/78751834e71291103d7d39bdd1bb48bc
>>
>>  Josh
>> _______________________________________________
>>  Bend-pm mailing list
>> Bend-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/bend-pm
> _________________________________________________
> Bend-pm mailing list
> Bend-pm at pm.org
> http://mail.pm.org/mailman/listinfo/bend-pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/bend-pm/attachments/20160824/8404e4e4/attachment.html>


More information about the Bend-pm mailing list