Trymodule

trymodule

It's never been easier to try nodejs modules!

Quickly install any node module you want and start a REPL with the installed module in the scope with trymodule!

Basically, it check if the module you are trying exists in the ~/.trymodule/node_module if require it and start a REPL or else installs it using npmi module and starts the REPL.

Get it: npm install -g trymodule

Sample usage:

1
2
3
4
5
6
7
8
nmotw.in> trymodule xkcd-imgs
Gonna start a REPL with packages installed and loaded for you
Couldn't find 'xkcd-imgs' locally, gonna download it now
[email protected] ../../Users/hhegadehallimadh/.trymodule/node_modules/xkcd-imgs
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Package 'xkcd-imgs' was loaded and assigned to 'xkcd_imgs' in the current scope
REPL started...
>
1
2
3
4
5
6
> xkcd_imgs
{ img: [Function] }
> xkcd_imgs.img( (err, res) => console.log(res) );
undefined
> { url: 'http://imgs.xkcd.com/comics/instagram.png',
  title: 'I\'m gonna call the cops and get Chad arrested for theft, then move all my stuff to the house across the street. Hopefully the owners there are more responsible.' }

GIF FTW!

trymodule

Suggest a module

Comments