Bower is used for installing and updating
packages (frameworks/libraries i.e. jquery, foundation, phonegap and many more)
swiftly through command line. It requires Node, NPM and git to run
successfully.
Commands
Note:-
Stay in the project folder while running these commands. Angular has been used
as an example of a package. Also, I am not covering the installation etc as they are very well defined in the official documentation of Bower.
#1.
bower install angular
#2.
bower uninstall angular
#3.
bower install angular#2.2.1 // Install specific version of the package
#4.
bower info angular
#5.
bower update // update all packages
#6.
bower install angular // to install only 1 package
#7.
bower list // version info regarding all the package
#8.
bower search angular
#9.
bower init // to generate bower.json file
#10.
bower install // install all the packages as per bower.json file dependencies
#11.
bower install angular --save // To add the library to bower.json as a
dependencies
#12.
bower install angular --save-dev // adding only to devDependencies
#13.
bower uninstall angular --save
#14.
bower cache list
#15.
bower cache clean
#16.
bower install angular -o // install on offline mode
#17.
bower install ../folderName // to install files from local directory
#18.
bower uninstall folderName
#20.
bower install --production // only install production dependency and not
install devDependencies
#19.
bower install foldername=angular // to install in foldername folder
#20.
bower help
#21.
bower help install
#22.
bower info angular
#23.
bower lookup angular
#24.
bower prune // uninstall non depency packages
#25.
bower install angular -j > output.json // create an output in json file
#26.
bower install jquery angular bootstrap --save //multiple package instalation
#27.
bower register package-name hithubURL // to register with bower for publishing
General Info
Main
configuration file - bower.json
bower.json is used by bower packages to give Bower information that it needs in order to install a package.
bower.json is used by bower packages to give Bower information that it needs in order to install a package.
.bowerrc file // to set custom location for bower components or library installation. Location of this file must be same as bower.json file.
For eg. - { "directory" : "js/lib" }
Extraneous means - The package is not listed in bower.json file as dependency.