├── .gitignore ├── .gitattributes ├── .travis.yml ├── ramda-repl.gif ├── cli.js ├── .jshintrc ├── .editorconfig ├── index.js ├── package.json ├── readme.md ├── greetings.js └── license /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 4 4 | - 6 5 | -------------------------------------------------------------------------------- /ramda-repl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemanth/ramda-repl/HEAD/ramda-repl.gif -------------------------------------------------------------------------------- /cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | const ramdaRepl = require('./')(); 4 | 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "esnext": true, 4 | "bitwise": true, 5 | "curly": true, 6 | "immed": true, 7 | "mocha": true, 8 | "newcap": true, 9 | "noarg": true, 10 | "undef": true, 11 | "unused": "vars", 12 | "strict": true 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const repl = require('repl'), 2 | history = require('repl.history'), 3 | R = require('ramda'), 4 | F = require('ramda-fantasy'), 5 | greetings = require('./greetings'); 6 | 7 | console.log(greetings); 8 | 9 | const Ewe = () => { 10 | const bleat = repl.start({ 11 | prompt: 'λ ', 12 | replMode: repl.REPL_MODE_STRICT 13 | }); 14 | history(bleat, process.env.HOME + '/.ramda_history'); 15 | bleat.context.R = R; 16 | R.map((r) => bleat.context[r] = R[r], R.keys(R)); 17 | bleat.context.F = F; 18 | R.map((f) => bleat.context[f] = F[f], R.keys(F)); 19 | } 20 | 21 | module.exports = Ewe; 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ramda-repl", 3 | "version": "4.1.3", 4 | "description": "Ramda + Ramda Fantasy REPL", 5 | "license": "MIT", 6 | "repository": "hemanth/ramda-repl", 7 | "author": { 8 | "name": "Hemanth.HM", 9 | "email": "hemanth.hm@gmail.com", 10 | "url": "h3manth.com" 11 | }, 12 | "bin": "cli.js", 13 | "engines": { 14 | "node": ">=5.0.0" 15 | }, 16 | "scripts": { 17 | "test": "mocha" 18 | }, 19 | "files": [ 20 | "index.js", 21 | "cli.js", 22 | "greetings.js" 23 | ], 24 | "keywords": [ 25 | "cli-app", 26 | "cli", 27 | "ramda", 28 | "ramda-repl" 29 | ], 30 | "dependencies": { 31 | "ramda": "^0.24.0", 32 | "ramda-fantasy": "^0.8.0", 33 | "repl.history": "^0.1.4", 34 | "chalk": "^1.1.3" 35 | }, 36 | "devDependencies": {} 37 | } 38 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ramda-repl 2 | > [Ramda](http://ramdajs.com/) + [ramda-fantasy](https://www.npmjs.com/package/ramda-fantasy) REPL 3 | 4 | 5 | ## Install 6 | 7 | ``` 8 | $ npm install --save ramda-repl 9 | ``` 10 | 11 | 12 | ## Usage 13 | 14 | ```js 15 | var ramdaRepl = require('ramda-repl'); 16 | 17 | ramdaRepl(); 18 | //=> Will start a REPL 19 | ``` 20 | 21 | 22 | ## CLI 23 | 24 | ```sh 25 | $ npm install --global ramda-repl 26 | ``` 27 | 28 | ```sh 29 | $ ramda-repl 30 | ``` 31 | 32 | __Will start a REPL as below with `R` as well as current context is extended with ramda__ 33 | 34 | ``` 35 | Welcome to Ramda REPL! 36 | 37 | λ > typeof R 38 | 'object' 39 | 40 | λ > typeof map 41 | 'function' 42 | 43 | λ > typeof zipWith 44 | 'function' 45 | 46 | ``` 47 | 48 | ## GIF FTW 49 | 50 | ![ramda-repl](./ramda-repl.gif) 51 | 52 | ## License 53 | 54 | MIT © [Hemanth.HM](http://h3manth.com) 55 | -------------------------------------------------------------------------------- /greetings.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const greetings = '\n' + 3 | chalk.magenta(' λλλλλλλλ \n') + 4 | chalk.magenta("λλλλλλλλλλ \n") + 5 | chalk.magenta("λλλλλλλλλλλλλλ \n") + 6 | chalk.magenta(" λλλλλλλλλλλλλ λλλλλλλ λλλλλλλ λλλλλλλ λλ \n") + 7 | chalk.magenta(" λλλλ λλλλλλλ λλ λλ λλ λλ λ λλ \n") + 8 | chalk.magenta(" λλλλ λλλλλλ λλλλλλλ λλλλλλλ λλλλλλλ λλ \n") + 9 | chalk.magenta(' λλλλ λλλλλ λλ λλλ λλ λλ λλ \n') + 10 | chalk.magenta("λλλλ λλλλ λλ λλλ λλλλλλλ λλ λλλλλλ\n") + 11 | 12 | chalk.gray("\n Welcome to the amazing ") + 13 | chalk.magenta("Ramda ") + 14 | chalk.gray("+ ") + 15 | chalk.magenta("ramda-fantasy ") + 16 | chalk.gray("+ ") + 17 | chalk.magenta("ES2015 ") + 18 | chalk.gray("REPL. \n"); 19 | 20 | module.exports = greetings; 21 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Hemanth.HM (h3manth.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | --------------------------------------------------------------------------------