Re:Show HN: CLI for trying out Node.js modules easier
by tolmasky on Monday March 14, 2016 @05:10AM
(#11281754)
Actually it is, at least the npm website. Every page on npm has a "try it now" link that takes you to a page on tonicdev where you can try the package. For example: http://tonicdev.com/npm/canvas - no need to download, build, or install. It loads a container so you have a real node environment (I'm a dev in this if you have any questions).
Re:Show HN: CLI for trying out Node.js modules easier
by BillinghamJ on Monday March 14, 2016 @12:06PM
(#11283620)
I use this regularly - it's great. Only issue is I can never remember the domain name! :)
It'd actually be pretty helpful if you made it something like https://try.tonicdev.com/npm/canvas because then I can just type "try." and my browser will find it for me.
Re:Show HN: CLI for trying out Node.js modules easier
by diggan on Monday March 14, 2016 @08:55AM
(#11282551)
Glad to see you here, I love tonicdev and use it when I can! Too bad I can't try out CLI/Terminal specific stuff in it, at least what I found so far...
However, one question, you guys have any plans for an offline version?
Re:Show HN: CLI for trying out Node.js modules easier
by Touche on Monday March 14, 2016 @09:44AM
(#11282829)
I want NPM to do less, not more. Start by fixing the cli, make it far less noisy than it is; think about whether you need to dump a project's entire dependency tree (which might consume my terminal's entire scrollable space -- a big no-no). Think about whether you should allow a module 6 levels deep that depends on a deprecated version of babel display warnings about that; is that relevant to my project? Oh, and group warnings together, don't dump them as you find them.
This is all just off the top of my head. Making it faster would be good too, shouldn't take 15 minutes to install a project's dependencies; pnpm and others are proving this is fixable.
Re:Show HN: CLI for trying out Node.js modules easier
by diggan on Monday March 14, 2016 @02:46AM
(#11281398)
Absolutely! And I'm no way the first person who did this, my inspiration comes from diving into clojure and finding `lein-try` (https://github.com/rkneufeld/lein-try).
Re:Show HN: CLI for trying out Node.js modules easier
by murukesh_s on Monday March 14, 2016 @10:05AM
(#11282936)
Just 57 lines of code. Someone was asking about beautiful code in other thread, I believe this is a fine example of it. Plumbing together reusable modules to build useful (and never before imagined) stuff. Kudos to the author and the node.js ecosystem..
Re:Show HN: CLI for trying out Node.js modules easier
by diggan on Monday March 14, 2016 @10:11AM
(#11282965)
Yeah, saw that though but can't agree that this would be an example of it. It's more an example of the later part, the beauty of having small modules, ready to be used and just plumbing them together in a small way.
Thanks for the kind words though, warms my heart that someone likes it.
Re:Show HN: CLI for trying out Node.js modules easier
by diggan on Monday March 14, 2016 @08:56AM
(#11282558)
Offline capabilities + easier to use for some people (one of them being me). Loading up a webpage every time I want to try some new nodejs module would not work as well as opening up a nodejs repl with the module loaded there.
Re:Show HN: CLI for trying out Node.js modules easier
by boucher on Monday March 14, 2016 @09:06AM
(#11282606)
Obviously it won't work offline if you haven't already installed the package (which seems like the general case?)
I'm biased of course, and I understand why some people are turned off by an in browser solution. But I think it's probably faster, in most cases, to try something you've never installed in Tonic than in this. (And I hope there's genuine value in things like being able to share links to your experiments.)
Re:Show HN: CLI for trying out Node.js modules easier
by diggan on Monday March 14, 2016 @09:15AM
(#11282668)
Yeah, that is true for sure, difference being that the 10% use-case (installed package before, offline now) is still usable if it's local and not on tonic-dev.
I like tonic-dev, don't get me wrong. But the workflow for using a package in tonic-dev is too slow compared to having it in a REPL, at least for me. Might be because I'm using Firefox and the performance for tonic-dev is terrible there, but mostly because I feel more at home in the terminal than in a js-editor in the browser.
I wish this was in NPM.
It'd actually be pretty helpful if you made it something like https://try.tonicdev.com/npm/canvas because then I can just type "try." and my browser will find it for me.
However, one question, you guys have any plans for an offline version?
This is all just off the top of my head. Making it faster would be good too, shouldn't take 15 minutes to install a project's dependencies; pnpm and others are proving this is fixable.
Thanks for your kind words though.
[0]: https://github.com/rkneufeld/lein-try [1]: https://github.com/devlinzed/cabal-try
And awesome to see I could inspire cabal-try to be conceived! (even though I do zero Haskell)
Thanks for the kind words though, warms my heart that someone likes it.
I'm biased of course, and I understand why some people are turned off by an in browser solution. But I think it's probably faster, in most cases, to try something you've never installed in Tonic than in this. (And I hope there's genuine value in things like being able to share links to your experiments.)
I like tonic-dev, don't get me wrong. But the workflow for using a package in tonic-dev is too slow compared to having it in a REPL, at least for me. Might be because I'm using Firefox and the performance for tonic-dev is terrible there, but mostly because I feel more at home in the terminal than in a js-editor in the browser.
It only works with web libraries though. Try searching for 'moment.js'
Try "require: markdown", for example.
I can put up a JavaScript version if it would be useful to anyone, it's not particularly complicated.