hashpipe
Hashpipe is an experimental JSON-based shell. Imagine that Bash was designed for manipulating web APIs instead of a filesystem.
Featuring:
- JSON-typed input & output (strings, numbers, objects, and arrays)
- Alternative piping constructs (like the parallel pipe
||
and sequential pipe|=
) - Modular design (
use
ing modules andalias
ing commands)
Getting started
Installation
$ npm install -g hashpipe$ hashpipe#|
At a glance
Bash-like command pipelines
#| cat names.txt | split '\n' | match John | sort 'John Adams' 'John King' 'John Lee' 'John Mitchell'
Parallel and series pipes to map commands over arrays
#| [1, 3, 4, 12] || * 5 5152060 #| echo john jacob jingleheimer | split ' ' || upper 'JOHN''JACOB''JINGLEHEIMER'
Special @
syntax for traversing JSON objects and arrays
#| ['a', 'b', 'c'] @ 0 'a' #| {name: "George", age: 55} @ name 'George' #| [{name: "Fred"}, {name: "Jerry"}, {name: "Tim"}] @ :name 'Fred''Jerry''Tim'
Designed for easy interaction with JSON APIs
#| get freegeoip.net/json country: 'United States' region: 'California' city: 'Mountain View' postal_code: '94043' #| {encoded: 'SGV5IHRoZXJl'} | post http://spro.webscript.io/base64 decoded: 'Hey there'
Learning more
Try one of the Hashpipe walkthroughs to see it in action: