Hacker GitHub

← All repos

Juniper/libxo

View on GitHub ↗ ★ 349 C

The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced.

16 mentions on Hacker News by 14 people: 4 stories, 12 comments · first 2015-02-15 · latest 2025-07-25

Mentions per year 16 mentions · busiest year 2021 (6)
20082026
  1. …have said this is anything new. FreeBSD has libxo[0] integrated into some of its tools: [0] https://github.com/Juniper/libxo
    comment by fvwmuser · 2025-07-25 · in 3-JSON
  2. …was solved with libxo[0]: Libxo happens to be in the base system, but it is generally available: * https://github.com/Juniper/libxo * https://libxo.readthedocs.io/en/latest/
  3. Or make it flexible: > libxo - A Library for Generating Text, XML, JSON, and HTML Output * https://github.com/Juniper/libxo/ * https://wiki.freebsd.org/LibXo Want structure? Ask for JSON or XML and parse. Otherwise it's the regular text…
    comment by throw0101c · 2023-02-25 · in Getting work done with PowerShell on Linux
  4. ▲ 1
    Libxo: Generate text/XML/JSON structured output in one code path
    story by goranmoomin · 2023-02-19 · 0 comments
  5. Can you trust it? Cli tool output is not exactly stable. I thought that's why libxo exists? https://github.com/Juniper/libxo
    comment by anecdotal1 · 2022-11-03 · in JC – JSONifies the output of many CLI tools
  6. ▲ 2
    Libxo: Library for Generating Text, XML, JSON, and HTML Output
    story by ingve · 2022-10-05 · 0 comments
  7. Something like https://github.com/Juniper/libxo is probably the best bet for non-powershell, non-python like things to ever be properly parseable.
  8. …in a format string. A "field descriptor" tells libxo what the field is and what it means. * https://github.com/Juniper/libxo Then add an "--output-format" option.
    comment by throw0101a · 2021-12-05 · in Tips on adding JSON output to your CLI app
  9. ▲ 3
    Libxo – A Library for Generating Text, XML, JSON, and HTML Output
    story by throw0101a · 2021-12-04 · 0 comments
  10. You're not the first person to think of that. See Juniper's libxo: https://github.com/Juniper/libxo It's integrated into a lot of FreeBSD's command line tooling, and is very useful, when it's available.
  11. ▲ 2
    A library for generating text, XML, JSON, and HTML output
    story by JNRowe · 2021-04-10 · 0 comments
  12. …for sharing. Their github README does a nice job of showing how it doesn't add a lot of work: https://github.com/Juniper/libxo
    comment by tyingq · 2021-01-19 · in Linux and Powershell
  13. …libxo is used by a chunk of the FreeBSD base tools to offer output in JSON, amongst other things: https://github.com/Juniper/libxo -% ps --libxo=json,pretty { "process-information": { "process": [ { "pid": "52455", "terminal-name": "5 ",…
    comment by Freaky · 2020-03-19 · in Illustrated Jq Tutorial
  14. …standardizing the format. FreeBSD started adopting this approach via libxo for its base utilities: https://github.com/Juniper/libxo . I hope it spreads into Linux.
    comment by int_19h · 2017-09-15 · in The Man Behind Windows PowerShell
  15. …of several ways. An example I am particularly fond of is using this tool as a poor man's libxo ( https://github.com/Juniper/libxo ): $ ps | sqawk -output json,indent=1 'select PID,TTY,TIME,CMD from a' trim=left header=1 [{ "PID" : "3947",…
  16. …in the base system, which will allow you to get (amongst others) JSON out of various commands: https://github.com/Juniper/libxo
    comment by Freaky · 2015-02-15 · in Show HN: A Unixy approach to WebSockets