{"id":23435017,"url":"https://github.com/ramda/repl","last_synced_at":"2025-04-13T03:20:08.291Z","repository":{"id":11050951,"uuid":"68151770","full_name":"ramda/repl","owner":"ramda","description":"The Ramda REPL","archived":false,"fork":false,"pushed_at":"2023-10-26T15:24:47.000Z","size":2700,"stargazers_count":35,"open_issues_count":13,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-10T00:29:36.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-13T22:14:40.000Z","updated_at":"2025-02-26T08:51:30.000Z","dependencies_parsed_at":"2023-12-19T03:04:07.047Z","dependency_job_id":"a53b8025-eebf-4d0e-b426-2afe87ac22a6","html_url":"https://github.com/ramda/repl","commit_stats":{"total_commits":35,"total_committers":11,"mean_commits":"3.1818181818181817","dds":0.4,"last_synced_commit":"77e8f4f6c6f7298d6a9ba94d770b510eccea0a18"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramda%2Frepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramda%2Frepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramda%2Frepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramda%2Frepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramda","download_url":"https://codeload.github.com/ramda/repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339225,"owners_count":21087215,"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","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":[],"created_at":"2024-12-23T12:38:50.616Z","updated_at":"2025-04-13T03:20:08.259Z","avatar_url":"https://github.com/ramda.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Ramda Repl\n==========\n\nA repl (read-eval-print-loop) for [Ramda](http://ramdajs.com/)\n\n[![Build Status](https://travis-ci.org/ramda/repl.svg?branch=master)](https://travis-ci.org/ramda/repl)\n\n---\n\n### Usage\n\n[dist/bundle.js](dist/bundle.js) will expose a global function called `ramdaRepl`.\n\n`ramdaRepl` is applied to two arguments (details to follow) and will immediately attempt to instantiate itself in the DOM.\n\nAn example with all the configuration options set is available [here](example/index.html).\n\n```js\nramdaRepl(target, config)\n```\n\n#### target\n\n`target` is a reference to a DOM Node, such as you would get from `document.querySelector`:\n\n```js\nvar target = document.querySelector('#my-text-area');\n```\n\nRamdaREPL will do the following operations with respect to the target DOM Node:\n\n- it will hide the target node\n- it will add itself to the DOM as a sibling to the target node\n- it will look for text within the target node and will prefill the input panel with this text (this can be overridden by the config)\n\n#### config\n\n`config` is a regular JavaScript object.\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eKey\u003c/th\u003e\n      \u003cth\u003eRequired\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eExample\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eapiURL\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eYes\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003eA path to a \u003ca href=\"https://developers.google.com/url-shortener/\"\u003eGoogle url-shortener\u003c/a\u003e service endpoint - this will require a specific API key, details \u003ca href=\"https://developers.google.com/url-shortener/v1/getting_started\"\u003ehere\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"https://www.googleapis.com/urlshortener/v1/url?key=APIKEY\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ereturnUrl\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eYes\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003eA URL (minus query string) that will be used with the url-shortening service to indicate where a sharable link will take user-agents. The current query string will be appended to this. This idea here is that you can have a REPL at \u003ccode\u003ehttp://your-ramda-repl.com#code\u003c/code\u003e and have the share feature redirect to \u003ccode\u003ehttp://ramdajs.com/repl#code\u003c/code\u003e should you wish.\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"http://ramdajs.com/repl/\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003einitialValue\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eNo\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003eUsed to provide the initial code in the input panel. It overrides the default behaviour, which is to use the content of the \u003ccode\u003etarget\u003c/code\u003e element.\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"identity(1)\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eonChange\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eNo\u003c/td\u003e\n      \u003ctd\u003eFunction\u003c/td\u003e\n      \u003ctd\u003eThis is called with the \u003cem\u003epre-compiled\u003c/em\u003e text from the input window whenever this text is changed. This can be used for updating the URL with a new query string, for example.\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n(code) =\u003e window.location.hash = URI.encode(code)\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eramdaScript\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eYes\u003c/td\u003e\n      \u003ctd\u003eObject - see below\u003c/td\u003e\n      \u003ctd\u003eA script description object used to defined where Ramda is sourced and how it is globally exposed\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n{\n  src    : \"//cdn.jsdelivr.net/ramda/latest/ramda.min.js\",\n  global : \"R\"\n}\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003escripts\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eNo\u003c/td\u003e\n      \u003ctd\u003eArray of Objects - see below\u003c/td\u003e\n      \u003ctd\u003eA list of script description objects used to defined where other interesting libraries are sourced and how they are globally exposed\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n[\n  {\n    src      :'//wzrd.in/standalone/sanctuary@latest',\n    global   : 'sanctuary',\n    exposeAs : 'S'\n  }\n]\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\nThe keys `ramdaScript` and `scripts` are used to organise the dynamically loaded scripts that will be available to the REPL, such as [Ramda][ramda], [Sanctuary][sanctuary], and [Ramda-Fantasy][ramda-fantasy].\nRamda is loaded first, as it is presumed that the other libraries will require it to be present before they can be included.\n\n[ramda]: http://ramdajs.com/\n[ramda-fantasy]: https://github.com/ramda/ramda-fantasy\n[sanctuary]: https://sanctuary.js.org/\n\nOrganising the scripts includes providing a reference to a URL where the script can be sourced - and adding in an optional configuration for how globals will be made available.\n\nHow the dynamically loaded scripts are made available can be defined using objects with the following keys:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eKey\u003c/th\u003e\n      \u003cth\u003eRequired\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eExample\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esrc\u003c/code\u003e \u003c/td\u003e\n      \u003ctd\u003eYes\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003eA URL referencing a JavaScript file\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"//cdn.jsdelivr.net/ramda/latest/ramda.min.js\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eglobal\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eYes if \u003ccode\u003eexposeAs\u003c/code\u003e or \u003ccode\u003eexpose\u003c/code\u003e are used \u003c/td\u003e\n      \u003ctd\u003e String \u003c/td\u003e\n      \u003ctd\u003e A name of a global the script will introduce\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"R\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eexposeAs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eNo\u003c/td\u003e\n      \u003ctd\u003eString\u003c/td\u003e\n      \u003ctd\u003eThe name of a global that will act as an alias to the global introduced by the script\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n\"RAMDA\"\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eexpose\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eNo\u003c/td\u003e\n      \u003ctd\u003eArray of Strings\u003c/td\u003e\n      \u003ctd\u003eA list of method names on the \u003ccode\u003eglobal\u003c/code\u003e that you wish to expose globally. \u003cstrong\u003eGiven this list is not provided all methods found on the \u003ccode\u003eglobal\u003c/code\u003e will be exposed\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cpre lang=\"js\"\u003e\n[\n  \"identity\",\n  \"map\",\n  \"filter\"\n]\n        \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Development\n\nYou will find a collection of [npm run *](https://docs.npmjs.com/cli/run-script) scripts in [package.json](package.json):\n\nTo run a simple server that will host the [example/index.html](example/index.html) file:\n\n```\nnpm run server\n```\n\nThis will start serving the _repl_ at [localhost:8080/example](http://localhost:8080/example)\n\nTo build the JavaScript bundle:\n\n```\nnpm run build-js\n```\n\nTo build the CSS bundle:\n\n```\nnpm run build-css\n```\n\n#### Watch modes\n\nTo build the JavaScript bundle when files change (with sourcemap support):\n\n```\nnpm run watch-js\n```\n\nTo build the CSS bundle when files change:\n\n```\nnpm run watch-css\n```\n\nTo watch both:\n\n```\nnpm run watch\n```\n\n#### Testing / Linting\n\nTo run tests:\n\n```\nnpm test\n```\n\nTo lint the JavaScript:\n\n```\nnpm run lint\n```\n\n#### Minification\n\nThe CSS is quite small and is minified while it is built.\n\nThe JavaScript is not minified by `npm run build-js` or `npm run watch-js` so those operations can run a little faster.\n\nTo minify the JavaScript:\n\n```\nnpm run minify\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framda%2Frepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framda%2Frepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framda%2Frepl/lists"}