HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Juniper
libxo
C2015–2025
Juniper / libxo

libxo

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.

14Distinct people
16Mentions
0Explicit recommenders
349GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year16 dated mentions

Observed mentions: 2015-02-15 14:35:38 UTC to 2025-07-25 15:12:02 UTC.

02462015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC624
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC211
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC312
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

16 sources
See also libxo: > 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. The application calls a function "xo_emit" to product output that is described 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.
In Tips on adding JSON output to your CLI app
Though it's pretty immature, nushell has a similar idea, with its own internal data model being streams of structured, typed data: https://www.nushell.sh/ And back to nix commands, 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 ", "state": "Is", "cpu-time": "0:00.00", "command": "-sh (sh)" }, -% uptime --libxo=json,pretty { "uptime-information": { "time-of-day": " 8:34p.m.", "uptime": 1730360, "days": 20, Be nice to see more tools converted.
In Illustrated Jq Tutorial
Object-oriented piping is actually somewhat problematic, because objects carry behavior, not just data. This means that everyone in the pipeline now has to agree on the semantics of that behavior - in case of PowerShell, they need to understand and talk the .NET object model, for example. A much more lightweight approach is to exchange structured data. This can even be easily done on top of existing byte streams, just 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.
In The Man Behind Windows PowerShell
https://github.com/dbohdan/sqawk It parses DSV data like Awk does, runs SQL queries against it and formats the output in one 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", "TTY" : "pts/2", "TIME" : "00:00:07", "CMD" : "zsh" },{ "PID" : "15951", "TTY" : "pts/2", "TIME" : "00:00:00", "CMD" : "ps" },{ "PID" : "15952", "TTY" : "pts/2", "TIME" : "00:00:00", "CMD" : "tclkit-8.6.3-mk" }] I started a list of command line tools for querying, processing and converting structured text data: https://github.com/dbohdan/structured-text-tools.
In Ask HN: What simple tools or products are you most proud of making?

Showing the 15 most recent of 16 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.