When trying out a module I start by downloading it into a new directory. I want to do that as fast as possible.
Versions used below
Test-driving a module
To try a module for the first time, my steps are:
npm install without having a package.json so technically
npm init is unnecessary. I do it because package.json is an easily accessible record of what version the test-drive code was written against.
init npm asks some questions and since the test-drive code won’t be reused, I don’t care about the answers. I press and hold
<enter> to accept the default answers. That’s more work than I want to do for this.
There’s a quicker way.
This will automatically accept the defaults.
-f stands for force. These flags also work:
There is no built-in option for bower but the unix
yes command will work. It outputs its argument followed by a newline indefinitely. Try
yes hi and then ctrl-c when you’ve had enough.
yes with empty string will be like hitting enter to accept the defaults.
That is still a decent bit of typing so alias it to something memorable.
.bashrc or somewhere: