ramda-cli-tutorial.md
https://gist.github.com/raine/d12d0ec3e72b2945510b
Thanks for the tutorial! A few things:
- After installing ramda-cli, I have command
ramda, notR. I see thatalias R='ramda'is in the readme but it could also go in this tutorial at the beginning. - I was confused by
reverse 'take 10'-- initially thinking thatreversetakestake 10as an argument. I suggest puttingreverseon a newline. I think this makes it more consistent by showing each line is equivalent to one argument toR.pipe:
curl -s $url | R -p 'filter where-eq fork: false' \
'project [\name \stargazers_count]' \
'sort-by prop \stargazers_count' \
reverse \
'take 10'
- Regarding run from file: Can I
requirethe version oframdainstalled byramda-cliin my script? Or should I installnpm install -g ramdaseparately?
Thanks for the feedback, Taylor.
- After writing the tutorial, I removed the
Rcommand alias from getting installed and changed it to recommendation of using a shell alias instead. - Good point. I think wrapping
reversein quotes would also help. - Good question. I believe using
require("ramda")would use ramda fromramda-cli. I'm not sure if ramda-cli would understand globally installed modules. It's probably not the best practice but I tend to install the modules to home directory. There could be a node_modules specific to ramda-cli. Likecd ~/.ramda-cli && npm install whatever.
If you have any thoughts or feedback on the readme also I'd appreciate that as well!
Hi @raine
Regarding bullet point 3: I could not load ramda-cli or ramda with require so I already went out looking for the answer. The story goes:
To use global modules, you can create a symlink via npm command
$ npm link name-of-module
This puts a symlink to the package in the local node_modules folder.
After this, you can directly require any of the module's dependencies (without having to install them separately) by following the folder pattern:
require('ramda-cli/node_modules/ramda')
I am planning on working through the readme at some point this week so I will get back to you on that one. Feel free to close this issue!