Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramda-cli-tutorial.md #7

Open
thurt opened this issue May 1, 2016 · 2 comments
Open

ramda-cli-tutorial.md #7

thurt opened this issue May 1, 2016 · 2 comments

Comments

@thurt
Copy link

thurt commented May 1, 2016

https://gist.github.com/raine/d12d0ec3e72b2945510b

Thanks for the tutorial!
A few things:

  • After installing ramda-cli, I have command ramda, not R. I see that alias 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 that reverse takes take 10 as an argument. I suggest putting reverse on a newline. I think this makes it more consistent by showing each line is equivalent to one argument to R.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 require the version of ramda installed by ramda-cli in my script? Or should I install npm install -g ramda separately?
@raine
Copy link
Owner

raine commented May 9, 2016

Thanks for the feedback, Taylor.

  • After writing the tutorial, I removed the R command alias from getting installed and changed it to recommendation of using a shell alias instead.
  • Good point. I think wrapping reverse in quotes would also help.
  • Good question. I believe using require("ramda") would use ramda from ramda-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. Like cd ~/.ramda-cli && npm install whatever.

If you have any thoughts or feedback on the readme also I'd appreciate that as well!

@thurt
Copy link
Author

thurt commented May 10, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants