What is Bower?October 16, 2014
If you haven’t heard of it, neither of many people.
So, I’m going to fix that now.
Bower is an open-source client-side HTML package manager from the people that brought you Twitter Bootstrap and..well, Twitter I suppose. If you’re a Ruby or Rails person, it’s like Gems. If you’re a .NET person, it’s like Nuget. If you’re a NodeJS person, it’s like the npm.
In other words, it’s nothing new.
Here’s what you do…
First you install it using npm. Oh, we’re using the command line for this.
npm install -g Bower --save-dev
We covered this last time, except this time the
-g flag is installing it globally, so I’ll have access to it from in folder.
Answer all the questions, and now you’ll have a bower.json that looks something like this.
Now it’s all configured. Next time you pull your code from source control into a new location, you can just
bower install and your dependencies will be installed into the
Don’t want the devDependencies? Then use
bower install --production and you’re good to go.
You can even define a different installation directory with a
.bowerrc file in your project. There are other options too you can configure too, but that one is the only one I use for my projects.
Package managers like Bower are nothing new, but for some reason, Bower remains moderately hidden to many that I talk to.
Thanks for playing. ~ DW