{"id":13447936,"url":"https://github.com/raine/ramda-cli","last_synced_at":"2025-10-06T20:12:44.033Z","repository":{"id":31816172,"uuid":"35382838","full_name":"raine/ramda-cli","owner":"raine","description":":ram: A CLI tool for processing data with functional pipelines","archived":false,"fork":false,"pushed_at":"2022-12-30T17:04:49.000Z","size":3243,"stargazers_count":576,"open_issues_count":26,"forks_count":12,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-10-04T07:37:07.371Z","etag":null,"topics":["cli","json","livescript","ramda"],"latest_commit_sha":null,"homepage":"","language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-10T18:30:09.000Z","updated_at":"2025-09-24T18:04:46.000Z","dependencies_parsed_at":"2023-01-14T19:50:11.610Z","dependency_job_id":null,"html_url":"https://github.com/raine/ramda-cli","commit_stats":null,"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"purl":"pkg:github/raine/ramda-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Framda-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Framda-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Framda-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Framda-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raine","download_url":"https://codeload.github.com/raine/ramda-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Framda-cli/sbom","scorecard":{"id":759440,"data":{"date":"2025-08-11","repo":{"name":"github.com/raine/ramda-cli","commit":"76d30c5c8a8d7bb1e920c78494e69d00907333ed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"96 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-4gw3-8f77-f72c","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-8cv5-p934-3hwp","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-r3x4-wr4h-pw33","Warn: Project is vulnerable to: GHSA-876r-hj45-fw7g","Warn: Project is vulnerable to: GHSA-v63x-xc9j-hhvq","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-w5q7-3pr9-x44w","Warn: Project is vulnerable to: GHSA-3fjq-93xj-3f3f","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T22:52:47.043Z","repository_id":31816172,"created_at":"2025-08-22T22:52:47.043Z","updated_at":"2025-08-22T22:52:47.043Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671791,"owners_count":26025756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","json","livescript","ramda"],"created_at":"2024-07-31T05:01:30.808Z","updated_at":"2025-10-06T20:12:43.986Z","avatar_url":"https://github.com/raine.png","language":"LiveScript","readme":"# 🐑 ramda-cli [![npm version](https://badge.fury.io/js/ramda-cli.svg)](https://www.npmjs.com/package/ramda-cli) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter]\n\nA tool for processing data with functional pipelines. In the command-line or\ninteractively in browser.\n\n```sh\n$ npm install -g ramda-cli\n$ curl -Ls https://bit.ly/gist-people-json | ramda \\\n  'filter (p) -\u003e p.city?.match /Port/ or p.name.match /^Dr\\./' \\\n  'map pick [\"name\", \"city\", \"mac\"]' \\\n  'take 3' \\\n  -o table --compact\n┌──────────────────┬─────────────────┬───────────────────┐\n│ name             │ city            │ mac               │\n├──────────────────┼─────────────────┼───────────────────┤\n│ Dr. Araceli Lang │ Yvettemouth     │ 9e:ea:28:41:2a:50 │\n│ Terrell Boyle    │ Port Reaganfort │ c5:32:09:5a:f7:15 │\n│ Libby Renner     │ Port Reneeside  │ 9c:63:13:31:c4:ac │\n└──────────────────┴─────────────────┴───────────────────┘\n```\n\nOr, pass in [`--interactive`](#interactive-mode) to launch in browser.\n\n![](https://raw.githubusercontent.com/raine/ramda-cli/media/interactive.png)\n\n## ✨ highlights\n\n- Build elegant data-processing pipelines in the command-line with Ramda's data-last API\n- No new syntax to learn: Use LiveScript or JavaScript, and the functions you know from Ramda\n- Use any npm module seamlessly\n- Interactive mode for building pipelines iteratively with instant feedback\n\n##### Table of Contents\n\n- [Interactive mode](#interactive-mode)\n- [Examples](#examples)\n- [JavaScript](#using-javascript)\n- [Options](#options)\n- [Evaluation context](#evaluation-context)\n- [Configuration](#configuration)\n- [Using packages from npm](#using-packages-from-npm)\n- [Promises](#promises)\n- [Debugging](#debugging)\n- [LiveScript?](#livescript)\n\n##### Resources\n\n- [Cookbook][cookbook]\n- [Tutorial: Using ramda-cli to process and display data from GitHub API][tutorial]\n- [Essential LiveScript for ramda-cli][essential-livescript]\n\n## install\n\n```sh\nnpm install -g ramda-cli\n```\n\n## synopsis\n\n```sh\ncat data.json | ramda [function] ...\n```\n\nThe idea is to [compose][composition] functions into a pipeline of operations\nthat when applied to given data, produces the desired output.\n\nBy default, the function is applied to a stream of JSON data read from stdin,\nand the output data is sent to standard out as JSON.\n\nTechnically, `function` should be a snippet of LiveScript (or JavaScript with\n`--js`) that evaluates into a function. If multiple `function` arguments are\nsupplied as positional arguments, they are composed into a pipeline in order\nfrom left to right.\n\nFor example, the command\n\n```sh\necho '[1,2,3]' | ramda 'filter (\u003e 1)' 'map multiply 2' 'product'\n24\n```\n\nis roughly equivalent in the following operation:\n\n```js\nR.pipe(\n  JSON.parse,\n  R.filter(x =\u003e x \u003e 1),\n  R.map(R.multiply(2)),\n  R.product,\n  JSON.stringify\n)('[1,2,3]') // \"24\"\n```\n\n(see [`R.pipe`](http://ramdajs.com/docs/#pipe)).\n\nAll Ramda's functions are available directly in the context. See\nhttp://ramdajs.com/docs/ for a full list and [Evaluation\ncontext](#evaluation-context) section for other functions.\n\n## interactive mode\n\n\u003ca href=\"https://raw.githubusercontent.com/raine/ramda-cli/media/interactive.png\"\u003e\n\u003cimg align=\"right\" width=\"250\" src=\"https://raw.githubusercontent.com/raine/ramda-cli/media/interactive_thumb.png?1\"/\u003e\n\u003c/a\u003e\n\n**New in v4.0**\n\nWhen launched with the `--interactive` parameter, ramda-cli opens in the\nbrowser. The pipeline, if given, is placed in an embedded code editor that\nemulates the prompt in command-line. As the pipeline is edited, changes to\noutput are reflected below in the output panel.\n\nIn interactive mode, ramda-cli is generally operated the same way as on the\ncommand-line. The key benefit is being able to develop pipelines incrementally\nwith much shorter feedback cycle.\n\nInput is passed to interactive mode in stdin, as usual.\n\nYou may pipe stdout to other commands even when using interactive mode. When the\ninteractive mode tab is closed, the result will printed to stdout.\n\n### copy-pasteable example\n\n```sh\ncurl -Ls http://bit.ly/gist-people-json | npx ramda-cli \\\n  'filter (p) -\u003e p.city is /Port/ or p.name is /^Dr\\./' \\\n  'filter (p) -\u003e p.email?.includes \".info\"' \\\n  'project \u003c[ name city mac email ]\u003e' \\\n  'take 100' \\\n  --interactive \\\n  -o table --compact\n```\n\n## examples\n\n```sh\n# Add 1 to each value in a list\necho [1,2,3] | ramda 'map add 1'\n[\n  2,\n  3,\n  4\n]\n```\n\n```sh\n# Add 1 to each value with inline ES6 lambda and take product of all\necho [1,2,3] | ramda --js 'map(x =\u003e x + 1)' product\n24\n```\n\n\u003e Ramda functions used:\n\u003e [`add`](http://ramdajs.com/docs/#add),\n\u003e [`map`](http://ramdajs.com/docs/#map),\n\u003e [`product`](http://ramdajs.com/docs/#product)\n\n##### Get a list of people whose first name starts with \"B\"\n\n```sh\ncat people.json | ramda 'pluck \\name' 'filter (name) -\u003e name.0 is \\B)' -o raw\nBrando Jacobson\nBetsy Bayer\nBeverly Gleichner\nBeryl Lindgren\n```\n\n\u003e Ramda functions used:\n\u003e [`pluck`](http://ramdajs.com/docs/#pluck),\n\u003e [`filter`](http://ramdajs.com/docs/#filter)\n\u003e Data: [people.json](https://gist.githubusercontent.com/raine/cd11686e0b8a4a43bbf6/raw/people.json)\n\n##### Create a markdown TODO list\n\n```sh\ncurl -s http://jsonplaceholder.typicode.com/todos |\\\n  ramda --raw-output \\\n    'filter where-eq user-id: 10' \\\n    'map (t) -\u003e \"- [#{t.completed \u0026\u0026 \"x\" || \" \"}] #{t.title}\"' \\\n    'take 5' \\\n    'unlines'\n```\n\n__Output__\n\n- [ ] ut cupiditate sequi aliquam fuga maiores\n- [x] inventore saepe cumque et aut illum enim\n- [x] omnis nulla eum aliquam distinctio\n- [ ] molestias modi perferendis perspiciatis\n- [ ] voluptates dignissimos sed doloribus animi quaerat aut\n\n\u003e Ramda functions used:\n\u003e [`filter`](http://ramdajs.com/docs/#filter),\n\u003e [`where-eq`](http://ramdajs.com/docs/#whereEq),\n\u003e [`map`](http://ramdajs.com/docs/#map)\n\n##### List versions of a npm module with ISO times formatted using a module from npm\n\n```sh\nnpm view ramda --json | ramda --import time-ago:ta \\\n  'prop \"time\"' \\\n  'to-pairs' \\\n  'map -\u003e version: it.0, time: ta.ago(it.1)' \\\n  'reverse' \\\n  -o table --compact\n...\n┌───────────────┬──────────────┐\n│ version       │ time         │\n├───────────────┼──────────────┤\n│ 0.26.1        │ 1 month ago  │\n│ 0.26.0        │ 2 months ago │\n│ 0.25.0        │ 1 year ago   │\n│ 0.24.1-es.rc3 │ 1 year ago   │\n│ 0.24.1-es.rc2 │ 1 year ago   │\n...\n```\n\n##### Search twitter for people who tweeted about ramda and pretty print [the result](https://raw.githubusercontent.com/raine/ramda-cli/media/twarc-ramda.png)\n\n```sh\ntwarc.py --search '#ramda' | ramda --slurp -p 'map path [\\user, \\screen_name]' uniq\n```\n\n\u003e Ramda functions used:\n\u003e [`map`](http://ramdajs.com/docs/#map),\n\u003e [`path`](http://ramdajs.com/docs/#path)\n\n\n##### Pull response status data from Graphite and visualize\n\nHTTP status codes per minute for last hour:\n\n```sh\ngraphite -t \"summarize(stats_counts.status_codes.*, '1min', 'sum', false)\" -f '-1h' -o json | \\\n  ramda --import sparkline 'map evolve datapoints: (map head) \u003e\u003e sparkline \\\n    'sort-by prop \\target' -o table\n```\n\n\n\u003ca href=\"https://raw.githubusercontent.com/raine/ramda-cli/media/graphite-http-codes.png\"\u003e\n\u003cimg width=\"256\" src=\"https://raw.githubusercontent.com/raine/ramda-cli/media/graphite-http-codes_thumb.png\"/\u003e\n\u003c/a\u003e\n\n\u003e Ramda functions used:\n\u003e [`evolve`](http://ramdajs.com/docs/#evolve),\n\u003e [`sortBy`](http://ramdajs.com/docs/#sortBy)\n\n##### Use `--slurp` to read multiple JSON objects into a single list before any operations\n\n```sh\ncat \u003c\u003cEOF | ramda --slurp identity\n\"foo bar\"\n\"test lol\"\n\"hello world\"\nEOF\n[\n  \"foo bar\",\n  \"test lol\",\n  \"hello world\"\n]\n```\n\n##### Solution to the [credit card JSON to CSV challenge](https://gist.github.com/jorinvo/2e43ffa981a97bc17259) using `--output-type csv`\n\n```bash\n#!/usr/bin/env bash\n\ndata_url=https://gist.githubusercontent.com/jorinvo/7f19ce95a9a842956358/raw/e319340c2f6691f9cc8d8cc57ed532b5093e3619/data.json\ncurl $data_url | ramda \\\n  'filter where creditcard: (!= null)' `# filter out those who don't have credit card` \\\n  'project [\\name, \\creditcard]'       `# pick name and creditcard fields from all objects` \\\n  -o csv \u003e `date \"+%Y%m%d\"`.csv        `# print output as csv to a file named as the current date`\n```\n\n##### List a project's dependencies in a table\n\n```sh\nnpm ls --json | ramda 'prop \\dependencies' 'map-obj prop \\version' -o table --compact\n┌───────────────┬────────┐\n│ JSONStream    │ 1.0.4  │\n│ treis         │ 2.3.9  │\n│ ramda         │ 0.14.0 │\n│ livescript    │ 1.4.0  │\n│ cli-table     │ 0.3.1  │\n└───────────────┴────────┘\n```\n\n\u003e Ramda functions used:\n\u003e [`filter`](http://ramdajs.com/docs/#filter),\n\u003e [`where`](http://ramdajs.com/docs/#where),\n\u003e [`project`](http://ramdajs.com/docs/#project),\n\u003e [`mapObj`](http://ramdajs.com/docs/#mapObj),\n\u003e [`prop`](http://ramdajs.com/docs/#prop)\n\n##### Generate HTML with hyperscript\n\n```sh\ncat \u003c\u003cEOF \u003e shopping.txt\nmilk\ncheese\npeanuts\nEOF\n```\n\n```sh\ncat shopping.txt | ramda --import hyperscript:h \\\n  -rR --slurp           `# read raw input into a list` \\\n  'map (h \\li.item, _)' `# apply \u003cli class=\"item\"\u003e into each item` \\\n  'h \\ul#list, _'       `# wrap list inside \u003cul id=\"list\"\u003e` \\\n  '.outer-HTML'         `# finally, grab the HTML`\n```\n\n```html\n\u003cul id=\"list\"\u003e\n  \u003cli class=\"item\"\u003emilk\u003c/li\u003e\n  \u003cli class=\"item\"\u003echeese\u003c/li\u003e\n  \u003cli class=\"item\"\u003epeanuts\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nReason for underscores (e.g. `h \\ul, _`) is that hyperscript API is not\ncurried (and can't be because it's variadic). We need to explicitly state\nthat this function is waiting for one more argument.\n\nFor more examples, see the [Cookbook][cookbook].\n\n## using javascript\n\nIf LiveScript is not your thing, you may write pipelines in JavaScript using the\n[`--js`](#--js) parameter.\n\n```sh\necho '[1,2,3]' | ramda --js 'map(x =\u003e x + 1)'\n[\n  2,\n  3,\n  4\n]\n```\n\n## options\n\n```\nUsage: ramda [options] [function] ...\n\n  -I, --interactive    run interactively in browser\n  -f, --file           read a function from a js/ls file instead of args; useful for\n                       larger scripts\n  -c, --compact        compact output for JSON and tables\n  -s, --slurp          read JSON objects from stdin as one big list\n  -S, --unslurp        unwraps a list before output so that each item is formatted and\n                       printed separately\n  -t, --transduce      use pipeline as a transducer to transform stdin\n  -P, --json-path      parse stream with JSONPath expression\n  -i, --input-type     read input from stdin as (#{format-enum-list INPUT_TYPES})\n  -o, --output-type    format output sent to stdout (#{format-enum-list OUTPUT_TYPES})\n  -p, --pretty         pretty-printed output with colors, alias to -o pretty\n  -D, --pretty-depth   set how deep objects are pretty printed\n  -r, --raw-input      alias for --input-type raw\n  -R, --raw-output     alias for --output-type raw\n  -n, --no-stdin       don't read input from stdin\n      --[no-]headers   csv/tsv has a header row\n      --csv-delimiter  custom csv delimiter character\n      --js             use javascript instead of livescript\n      --import         import a module from npm\n  -C, --configure      edit config in $EDITOR\n  -v, --verbose        print debugging information (use -vv for even more)\n      --version        print version\n  -h, --help           displays help\n```\n\n\n#### `-I, --interactive`\n\nLaunch interactive mode in browser.\n\nSee [Interactive mode](#interactive-mode).\n\n#### `-f, --file`\n\nLoad a function pipeline from a file. Useful for scripts difficult to express\nin command-line.\n\n__Example__\n\n```js\n// shout.js\nvar R = require('ramda');\nmodule.exports = R.pipe(R.toUpper, R.add(R.__, '!'));\n```\n\n```sh\necho -n '\"hello world\"' | ramda --file shout.js\n\"HELLO WORLD!\"\n```\n\nYou can overwrite command-line arguments through the script by exporting a\nstring in property `opts`.\n\n```js\nmodule.exports = function() { /* ... */ }\nmodule.exports.opts = '--slurp -o table'\n```\n\n#### `-c, --compact`\n\nPrint compact tables and JSON output without whitespace.\n\nWhen used with `--output-type raw`, no line breaks are added to output.\n\n__Example__\n\n```sh\nseq 10 | ramda --input-type raw --output-type raw --compact identity # or -rRc\n12345678910%\n```\n\n#### `-s, --slurp`\n\nRead all input from `stdin` and wrap the data in a list before operations.\n\n__Example__\n\n```sh\ncat \u003c\u003cEOF | ramda --slurp 'map to-upper'\n\"foo\"\n\"bar\"\n\"xyz\"\nEOF\n[\n  \"FOO\",\n  \"BAR\",\n  \"XYZ\"\n]\n```\n\n#### `-S, --unslurp`\n\nAfter the pipeline is applied to an item and if the result is an array, its\nitems are printed separately.\n\n__Example__\n\n```sh\necho '[1,2,3]' | ramda --unslurp 'map inc'\n2\n3\n4\n```\n\n#### `-t, --transduce`\n\nTransform the input stream using the pipeline as a\n[transducer][transducers-explained]. Requires all functions in the pipeline\nto be able to act as transducers.\n\nThis option essentially allows performing operations like\n[`R.map`](http://ramdajs.com/docs/#map) or\n[`R.filter`](http://ramdajs.com/docs/#filter) on items as they come without\nwaiting for the stream to complete or wrapping the input stream in a\ncollection with [`--slurp`](#-s---slurp).\n\n__Example__\n\n```sh\necho '1 2 2 3 3 4' | ramda --transduce drop-repeats\n1\n2\n3\n4\n```\n\n#### `-P, --json-path`\n\nParse the input stream with given [JSONPath](http://goessner.net/articles/JsonPath/) expression.\n\nSee also: [JSONStream documentation](https://github.com/dominictarr/JSONStream#jsonstreamparsepath)\n\n__Examples__\n\nProcess a huge JSON array one by one without reading the whole thing first.\n\n`*` as JSON path unwraps the array and objects are passed to `identity` one by one.\n\n```sh\ncurl -Ls http://bit.do/countries-json | ramda --json-path '*' --compact identity\n{\"name\":\"Afghanistan\",\"code\":\"AF\"}\n{\"name\":\"Åland Islands\",\"code\":\"AX\"}\n{\"name\":\"Albania\",\"code\":\"AL\"}\n...\n```\n\n#### `-i, --input-type`\n\nParse `stdin` as one of these formats: `raw`, `csv`, `tsv`.\n\n__Examples__\n\n```sh\necho foo | ramda --input-type raw to-upper\n\"FOO\"\n```\n\n```sh\n$ cat \u003c\u003cEOF | ramda --input-type csv identity\nid,name\n1,Bob\n2,Alice\nEOF\n[\n  { \"id\": \"1\", \"name\": \"Bob\" },\n  { \"id\": \"2\", \"name\": \"Alice\" }\n]\n```\n\n#### `-o, --output-type`\n\nInstead of JSON, format output as one of: `pretty`, `raw`, `csv`, `tsv`, `table`.\n\n##### `-o pretty`\n\nPrint pretty output.\n\n##### `-o raw`\n\nWith raw output type when a string value is produced, the result will be\nwritten to stdout as is without any formatting.\n\n##### `-o csv` and `-o tsv`\n\nCSV or TSV output type can be used when pipeline evaluates to an array of\nobjects, an array of arrays or when stdin consists of a stream of bare\nobjects. First object's keys will determine the headers.\n\n##### `-o table`\n\nPrint nearly any type of data as a table. If used with a list of objects,\nuses the first object's keys as headers.\n\n__Example__\n\n```sh\ncurl -Ls http://bit.do/countries-json | ramda 'take 3' -o table --compact\n┌───────────────┬──────┐\n│ name          │ code │\n├───────────────┼──────┤\n│ Afghanistan   │ AF   │\n│ Åland Islands │ AX   │\n│ Albania       │ AL   │\n└───────────────┴──────┘\n```\n\n#### `-p, --pretty`\n\nAlias of `--output-type pretty`.\n\n#### `-D, --pretty-depth`\n\nWhen using pretty-printed output, set how deep structures are verbosely\nprinted.\n\nUseful when output is huge and you want to see the general structure of an\nobject or list.\n\nSee documentation of [`util.inspect(object[, options])`](https://nodejs.org/api/util.html#util_util_inspect_object_options)\n\n#### `-n, --no-stdin`\n\nDon't read `stdin` for input. Useful when starting a pipeline with a constant\nfunction.\n\n__Example__\n\n```sh\nramda --no-stdin 'always \"hello world\"' 'add __, \\!'\n\"hello world!\"\n```\n\n#### `--[no-]headers`\n\nSet if input csv/tsv contains a header row.\n\nBy default, csv/tsv input is assumed to contain headers.\n\n#### `--csv-delimiter`\n\nUse a custom csv delimiter. Delimiter is comma by default.\n\nExample: `--csv-delimiter=';'`\n\n#### `--js`\n\nInterpret positional arguments as JavaScript instead of LiveScript.\n\n__Example__\n\n```sh\necho '[1,2,3]' | ramda --js 'map(x =\u003e Math.pow(x, 2))'\n[\n  1,\n  4,\n  9\n]\n```\n\n#### `--import \u003cpackage\u003e`\n\nInstall given package from npm, and make it available in the pipeline.\n\nSymbol `:` combined with a name can be used to declare the variable name module\nshould appear as. Otherwise, it is imported as camelcased name of the module.\n\nCan be used multiple times to import more than one module.\n\n__Example__\n\n```sh\necho test | ramda -rR --import chalk:c 'c.bold'\n**test**\n```\n\n#### `-C, --configure`\n\nEdit ramda-cli config file in `$EDITOR`.\n\nSee [Configuration](#configuration).\n\n## evaluation context\n\n### functions\n\nAll of [Ramda's functions][ramda-docs] are available, and also:\n\n| function       | signature                    | description                                      |\n|----------------|------------------------------|--------------------------------------------------|\n| `id`           | `a → a`                      | Alias to `R.identity`                            |\n| [`flat`][flat] | `* → Object`                 | Flatten a deep structure into a shallow object   |\n| `readFile`     | `filePath → String`          | Read a file as string                            |\n| `lines`        | `String → [String]`          | Split a string into lines                        |\n| `words`        | `String → [String]`          | Split a string into words                        |\n| `unlines`      | `[String] → String`          | Join a list of lines into a string               |\n| `unwords`      | `[String] → String`          | Join a list of words into a string               |\n| `then`         | `Function → Promise`         | Map a value inside Promise                       |\n| `pickDotPaths` | `[k] → {k: v} → {k: v}`      | Like `R.pick` but deep using dot delimited paths |\n| `renameKeysBy` | `Function → {k: v} → {k: v}` | Like `R.map` but for keys instead of values      |\n\n### objects\n\n| object    | description                         |\n|-----------|-------------------------------------|\n| `process` | https://nodejs.org/api/process.html |\n| `console` | https://nodejs.org/api/console.html |\n\n`process.exit()` can be used to short-circuit pipeline in case of an error,\nfor example:\n\n```sh\ncurl api | ramda 'tap (res) -\u003e if res.error then console.error(res); process.exit(1)'\n```\n\nAn alternative is to use `Maybe` type.\n\n## configuration\n\n### config file\n\nPath: `$HOME/.config/ramda-cli.{js,ls}`\n\nThe purpose of a global config file is to carry functions you might find\nuseful to have around. The functions it exports in an object are made\navailable.\n\nFor example,\n\n```js\n// ~/.config/ramda-cli.js\nexports.date = (val) =\u003e new Date(val);\nexports.timeago = require('timeago');\nexports.debug = (val) =\u003e {\n  console.log('debug:', val);\n  return val;\n};\n```\n\n```sh\necho 1442667243000 | ramda date debug timeago\ndebug: Sat Sep 19 2015 12:54:03 GMT+0000 (UTC)\n\"12 minutes ago\"\n```\n\n### default options\n\nTo make some options be passed by default, it is best to use a shell alias.\nFor example:\n\n```sh\n# always interpret as javascript\nalias ramda=\"ramda --js\"\necho 1 | ramda '(x) =\u003e x + 1'\n2\n```\n\n## using packages from npm\n\n**New in v5.0**: `ramda-cli` installs specified modules transparently from npm,\nmanual installation is no longer required.\n\nWith the `--import` parameter, any module from npm can be installed and imported\ninto the pipeline context. Invocations with a particular module will be instant\nonce installed.\n\n\u003cimg src=\"https://raw.githubusercontent.com/raine/ramda-cli/media/import.png?1\" width=\"874\" height=\"443\"\u003e\n\n## promises\n\nPromise values are unwrapped at the end of pipeline.\n\n`then` helper function can be used to map promise values.\n\n```sh\necho 1 | ramda --js 'x =\u003e Promise.resolve(x)' 'then(add(5))'\n6\n```\n\n```sh\necho '192.168.1.1\\ngoogle.com\\nyahoo.com' | \\\n  ramda -r --js --import ping 'ping.promise.probe' 'then(omit([\"output\", \"numeric_host\"]))' | \\\n  ramda --slurp -o table --compact\n┌─────────────┬───────┬─────────┬─────────┬─────────┬─────────┬────────┐\n│ host        │ alive │ time    │ min     │ max     │ avg     │ stddev │\n├─────────────┼───────┼─────────┼─────────┼─────────┼─────────┼────────┤\n│ 192.168.1.1 │ true  │ 1.325   │ 1.325   │ 1.325   │ 1.325   │ 0.000  │\n│ google.com  │ true  │ 10.729  │ 10.729  │ 10.729  │ 10.729  │ 0.000  │\n│ yahoo.com   │ true  │ 115.418 │ 115.418 │ 115.418 │ 115.418 │ 0.000  │\n└─────────────┴───────┴─────────┴─────────┴─────────┴─────────┴────────┘\n```\n\n## debugging\n\nYou can turn on the debug output with `-v, --verbose` flag. Use `-vv` for\neven more verbose output.\n\nVerbose output shows what entered LiveScript compiled to.\n\nTo debug individual functions in the pipeline, you can use something like [`treis`][treis].\n\n```sh\necho 1 | ramda --import treis 'treis(add(1))'\n```\n\n```\nf1 a: 1\nf1 =\u003e 2\n2\n```\n\n## livescript?\n\n\u003e [LiveScript][livescript] is a language which compiles to JavaScript. It has\na straightforward mapping to JavaScript and allows you to write expressive\ncode devoid of repetitive boilerplate.\n\n### comparison table\n\nAll expressions in the table evaluate to a function, and are valid in\nramda-cli.\n\n| Ramda                     | LiveScript          | JavaScript                |\n|---------------------------|---------------------|---------------------------|\n| `not`                     | `(not)`             | `x =\u003e !x`                 |\n| `nth(0)`                  | `(.0)`              | `x =\u003e x[0]`               |\n| `prop('name')`            | `(.name)`           | `x =\u003e x.name`             |\n| `add(1)`                  | `(+ 1)`             | `x =\u003e x + 1`              |\n| `add(__, '!')`            | `(+ '!')`           | `x =\u003e x + '!'`            |\n| `gt(__, 2)`               | `(\u003e 2)`             | `x =\u003e x \u003e 2`              |\n| `contains(__, xs)`        | `(in xs)`           | `x =\u003e xs.includes(x)`     |\n| `pipe(length, gt(__, 2))` | `(.length \u003e 2)`     | `x =\u003e x.length \u003e 2 `      |\n| `isNil`                   | `(~= null)`         | `x =\u003e x == null`          |\n| `complement(isNil)`       | `(!~= null)`        | `x =\u003e x != null`          |\n| `match(/foo/)`            | `(is /foo/)`        | `x =\u003e x.match(/foo/)`     |\n| `replace('a', '')`        | `(- 'a')`           | `x =\u003e x.replace('a', '')` |\n| `join(',')`               | `(* ',')`           | `x =\u003e x.join(',')`        |\n| `split(',')`              | `(/ ',')`           | `x =\u003e x.split(',')`       |\n| `toUpper`                 | `(.to-upper-case!)` | `x =\u003e x.toUpperCase()`    |\n\nSee also: [Essential LiveScript for ramda-cli][essential-livescript]\n\n## questions or suggestions?\n\n[Open an issue](https://github.com/raine/ramda-cli/issues/new)\n\n## contributors\n\n- [Kun Zhou](https://github.com/mmqmzk)\n\n[flat]: https://github.com/hughsk/flat\n[composition]: http://en.wikipedia.org/wiki/Function_composition_%28computer_science%29\n[livescript]: http://livescript.net\n[treis]: https://github.com/raine/treis\n[hyperscript]: https://github.com/dominictarr/hyperscript\n[ramda]: http://ramdajs.com\n[ramda-docs]: http://ramdajs.com/docs/\n[tutorial]: https://gistlog.co/raine/d12d0ec3e72b2945510b\n[essential-livescript]: https://gistlog.co/raine/6486b985c767954781b1\n[cookbook]: https://github.com/raine/ramda-cli/wiki/Cookbook\n[transducers-explained]: http://simplectic.com/blog/2014/transducers-explained-1/\n[gitter]: https://gitter.im/raine/ramda-cli\n","funding_links":[],"categories":["LiveScript","Data Manipulation","cli","\u003ca name=\"data-management\"\u003e\u003c/a\u003eData management"],"sub_categories":["Processors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Framda-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraine%2Framda-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Framda-cli/lists"}