HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
h4l
json.bash
Shell2024–2024
h4l / json.bash

json.bash

Command-line tool and bash library that creates JSON

2Distinct people
4Mentions
0Explicit recommenders
460GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Command-line tool and bash library that creates JSON

GitHub

Where it is used

No documented product use has been verified yet.

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 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 9:02:44 AM 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 hour4 dated mentions

Observed mentions: 2024-07-03 10:18:00 UTC to 2024-07-03 17:39:25 UTC.

012024-07-03 10:00:00 UTC to 2024-07-03 11:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsJul 3, 10:002024-07-03 11:00:00 UTC to 2024-07-03 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-03 12:00:00 UTC to 2024-07-03 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-03 13:00:00 UTC to 2024-07-03 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJul 3, 13:002024-07-03 14:00:00 UTC to 2024-07-03 15:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-07-03 15:00:00 UTC to 2024-07-03 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-03 16:00:00 UTC to 2024-07-03 17:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-07-03 17:00:00 UTC to 2024-07-03 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJul 3, 17:00

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
Jul 3, 10:002024-07-03 10:00:00 UTC2024-07-03 11:00:00 UTC110
Jul 3, 11:002024-07-03 11:00:00 UTC2024-07-03 12:00:00 UTC000
Jul 3, 12:002024-07-03 12:00:00 UTC2024-07-03 13:00:00 UTC000
Jul 3, 13:002024-07-03 13:00:00 UTC2024-07-03 14:00:00 UTC000
Jul 3, 14:002024-07-03 14:00:00 UTC2024-07-03 15:00:00 UTC101
Jul 3, 15:002024-07-03 15:00:00 UTC2024-07-03 16:00:00 UTC000
Jul 3, 16:002024-07-03 16:00:00 UTC2024-07-03 17:00:00 UTC101
Jul 3, 17:002024-07-03 17:00:00 UTC2024-07-03 18:00:00 UTC101

What Hacker News says

1 sources
h4l·Jul 3, 2024Submission

Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON

jb is a UNIX tool that creates JSON, for shell scripts or interactive use. Its "one thing" is to get shell-native data (environment variables, files, program output) to somewhere else, using JSON encapsulate it robustly. I wrote this because I wanted a robust and ergonomic way to create ad-hoc JSON data from the command line and scripts. I wanted errors to not pass silently, not coerce data types, not put secrets into argv. I wanted to leverage shell features/patterns like process substitution, environment variables, reading/streaming from files and null-terminated data. If you know of the jo program, jb is similar, but type-safe by default and more flexible. jo coerces types, using flags like -n to coerce to a specific type (number for -n), without failing if the input is invalid. jb encodes values as strings by default, requiring type a
Read the rest
nnotations to parse & encode values as a specific type (failing if the value is invalid). If you know jq, jb is complementary in that jq is great at transforming data already in JSON format, but it's fiddly to get non-JSON data into jq. In contrast, jb is good at getting unstructured data from arguments, environment variables and files into JSON (so that jq could use it), but jb cannot do any transformation of data, only parsing & encoding into JSON types. I feel rather guilty about having written this in bash. It's something of a boiled frog story. I started out just wanting to encode JSON strings from a shell script, without dependencies, with the intention of piping them into jq. After a few trials I was able to encode JSON strings in bash with surprising performance, using array operations to encode multiple strings at once. It grew from there into a complete tool. I'd certainly not choose bash if I was starting from scratch now...
183 points · Open discussion

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.