Recently we've been moving away from using Bower and just using npm to manage our project dependencies.

See: Why we should stop using Bower - and how to do it.

Most of the time it's pretty smooth as the majority of projects are available through npm as well as Bower, but what of the ones that just aren't?

Yesterday I wanted to try out Todd Motto's switch-messages.js with an AngularJS 1.2 project (yes; IE8) but it hasn't been submitted to npm and I didn't want to manually include the dependency or absorb the code directly into our build.

When I looked at the project I noticed that he'd referenced the git repo for installing through Bower:

bower install

I tried the same through npm and (of course) it works.

npm install --save-dev

This results in the following within our package.json:

"devDependencies": {
	"switch-messages.js": "git://"

This is most likely something already known that we've just missed but I though I'd share for those who, like us haven't done this before.

This may not work with every git repo out there and most likely requires a valid package.json to be present but it's certainly something to try when a project is not already available via npm.