Skip to content
Raine Virta edited this page May 31, 2015 · 40 revisions

Feel free to contribute to this document with ramda-cli snippets that have helped you.

Recipes

Create a markdown formatted table of Ramda's functions

npm install -g markdown-table-cli
curl -s https://raine.github.io/ramda-json-docs/latest.json | \
  R 'project <[ name sig category ]>' \
    'map evolve sig: (-> it and "`#it`"), name: -> "[`#it`](http://ramdajs.com/docs/##it)"' \
  | md-table
name sig category
add Number -> Number -> Number Math
adjust (a -> a) -> Number -> [a] -> [a] List
always a -> (* -> a) Function
aperture Number -> [a] -> [[a]] List

Merge JSON files into a single object

cat *.json | R --slurp merge-all

Unwrap a list of objects into Line Delimited JSON

cat data.json | R --unslurp --compact identity

Read filenames from stdin as an object of {filename: body}

find . -name '*.txt' | R -r --slurp 'map -> (it): read-file it' merge-all
Clone this wiki locally