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)
$ npm install -g hashpipe
$ hashpipe
#|
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
[ 5, 15, 20, 60 ]
#| 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 http://www.telize.com/geoip
{ country: 'United States',
region: 'California',
city: 'Mountain View',
postal_code: '94043' }
#| {encoded: 'SGV5IHRoZXJl'} | post http://spro.webscript.io/base64
{ decoded: 'Hey there' }
Try one of the Hashpipe walkthroughs to see it in action: