2 ms·
While jq is definitely faster, for more complex tasks I love using ramda-cli [1]. It has all the functions from the excellent Ramda [2] AND you can use LiveScri
by andrvo 9y ago
While jq is definitely faster, for more complex tasks I love using ramda-cli [1]. It has all the functions from the excellent Ramda [2] AND you can use LiveScript's [3] terser syntax (and pipes!).
Here's a quick command to output a list of recent files on Linux:
xml2json < ~/.local/share/recently-used.xbel | ramda '.xbel.bookmark |> pluck \href |> map replace /file:\/\//, ""' -o raw
1. https://github.com/raine/ramda-cli https://github.com/raine/ramda-cli
2. http://ramdajs.com/ http://ramdajs.com/
3. http://livescript.net/ http://livescript.net/
- andrvo 9y agoAnd here's a more interesting example using output from Algolia's search API: curl 'https://<redacted Algolia url>' | ramda '.hits |> map pick <[title url story_url objectID points num_comments]> |> evolve title: take 2 |> sort (.points) |> reverse'