Bower can be installed using NPM by the following command.
npm install -g bower
The importance of Bower is that it keeps flat package hierarchy which means that it doesn't install the dependencies underneath the things which depends on it. For example Bootstrap depends on jQuery thus bower will install jQuery and Bootstrap on the same level instead of installing jQuery multiple times. This is also known as a flat dependency graph and it helps reduce page load. It works very similar to NPM. Just type bower in the command line you will get set of commands and usage as shown below
To initialize bower we need to run command bower init. Then it will ask some questions like name, description author, licence etc. You can ignore those questions and set the defaults value to each one of them. Once done you will get a bower.json file that has all the answers to all the questions you have answered as shown below.
Install packages using command bower install <package_name>, which installs the package into the folder names bower_components
For example we will install Bootstrap (bower install bootstrap) as shown below.
Please Like and Share the CodingDefined.com Blog, if you find it interesting and helpful.