rq
rq is a jq inspired command-line swiss-army tool
Installation
npm install -g @reaktivo/rq
Usage
rq 'fetch`https://httpbin.org/ip`.then(res => res.json()).then(res => res.origin)'
77.173.111.54
# Since we also expose lodash/fp, the previous command is equivalent to the following
rq 'fetchJson `https://httpbin.org/ip`, get `origin`, split `.`'
77.173.111.54
rq 'fetchJson `https://httpbin.org/ip`' 'get `origin`' 'split `.`'
Out of the box, rq allows you to safely evaluate javascript with the following globals exposed:
- [x] fetch: A browser compatible fetch implementation
- [x] fetchJson, fetchBody: Shortcuts for the fetch function
- [x] lodash/fp methods
- [ ] Rxjs Operators: map, filter, switchMap, etc
Development
Testing is done via the tap and is intended to be simple and straight to the point.
npm test
Acknowledgements
I'm thankful to the authors of the following related projects which server as inspiration to rq:
License
rq is open source software licensed as MIT.