Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 883 Bytes

File metadata and controls

48 lines (30 loc) · 883 Bytes

jsonfmt

Ein JSON Pretty-Printer

Liest ein JSON-Dokument von der Standardeingabe, formatiert es und schreibt es auf die Standardausgabe. Keine Konfiguration, keine Kommandozeilenargumente.

jsonfmt

Die Formatierung operiert ausschließlich auf dem JSON-Syntaxbaum. Whitespace (Zeilenumbrüche etc.) spielt keine Rolle. Kommata werden am Zeilenanfang platziert.

Der Code basiert auf einer kleinen Bibliothek für kombinatorisches Parsen, die ich selbst geschrieben habe.

Installation

Einfach kompilieren, als ausführbar markieren und in ein $PATH Verzeichnis verschieben, bspw.:

$ scripts/build.fish
$ chmod +x jsonfmt
$ mv jsonfmt ~/.local/bin/

Verwendung

Jeder Editor, der Text durch eine externe Anwendung pipen kann, kann jsonfmt verwenden.

Helix, Kakoune

%|jsonfmt

Vim/Neovim

:%!jsonfmt