Responsive Web Design by Example:Beginner's Guide(Second Edition)
上QQ阅读APP看书,第一时间看更新

Managing project dependency with Bower

We will need a number of libraries to manage a project dependency with Bower. In the web development context, we refer to a library as a collection of code, usually CSS and JavaScript, to add features on the website. Often, the website is dependent on a particular library for it to function its prime feature. As an example, if I built a website to convert currencies, the website will require Account.js (http://josscrowcroft.github.io/accounting.js/); it is a handy JavaScript library to convert regular numbers into currency format with the currency symbol.

It is common that we may add about five or more libraries on a single website, but maintaining all the libraries used in the website and making sure that they are all up-to-date could become cumbersome. This is where Bower is useful.

Bower (package manager. It is a handy tool that streamlines the way we add, update, and remove libraries or dependencies (libraries that are required for the project) in our project. Bower is a Node.js module, so we first have to install Node.js (http://nodejs.org/) on our computer to be able to use Bower.