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:
$ mkdir foo-test-drive
$ cd $_
$ npm init
$ npm install foo -S
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.
$ npm init -y
This will automatically accept the defaults.
-y stands for yes as in say yes to all the prompts. 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.
$ yes '' | bower init
That is still a decent bit of typing so alias it to something memorable.
.bashrc or somewhere:
alias bowerf="yes '' | bower init"