Jshon

Jul 20, 2023

JSON parser for the shell

Jshon parses, reads and creates JSON. It is designed to be as usable as possible from within the shell and replaces fragile ad hoc parsers made from grep/sed/awk as well as heavyweight one-line parsers made from perl/python.

Jshon loads JSON text from stdin, performs actions, then displays the last action on stdout. Some of the options output JSON, others output plain text meta information. Because Bash has very poor nested data structures, Jshon does not try to return a native bash data structure as a typical library would. Instead, Jshon provides a history stack containing all the manipulations.

The big change in the latest release is switching the everything from pass-by-value to pass-by-reference. In a typical use case processing AUR search results for ‘python’ by-ref is twice as fast and uses one sixth the memory. If you are editing JSON, by-ref also makes your life a lot easier as modifications do not need to be manually inserted through the entire stack.



Checkout these related ports:
  • Zxing-cpp - ZXing C++ Library for QR code recognition
  • Zu-hunspell - Zulu hunspell dictionaries
  • Zu-aspell - Aspell Zulu dictionary
  • Zq - Easier and faster alternative to jq
  • Zorba - General purpose C++ XQuery processor
  • Zenxml - Simple C++ XML Processing
  • Zed - Command-line tool to manage and query Zed data lakes
  • Yq - Command-line YAML and XML processor, jq wrapper for YAML/XML documents
  • Yould - Pronounceable word generator
  • Yodl - Easy to use but powerful document formatting/preparation language
  • Yi-hunspell - Yiddish hunspell dictionaries
  • Yi-aspell - Aspell Yiddish dictionary
  • Yelp-xsl - DocBook XSLT stylesheets for yelp
  • Yelp-tools - Utilities to help manage documentation for Yelp and the web
  • Ydiff - Diff readability enhancer for color terminals