Skip to content

Instantly share code, notes, and snippets.

View hamzahasbi's full-sized avatar
:atom:
Self-branding

Hasbi Hamza hamzahasbi

:atom:
Self-branding
View GitHub Profile
@kristopherjohnson
kristopherjohnson / formatjson.js
Last active May 25, 2025 20:08
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();