Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower doesn ' t concatenate or minify code or do anything else-it just installs the right versions of the packages you nee D and their dependencies. Bower is optimized for the front-end. Bower is the front-end package manager, to help us solve the third-party library version updates, installation, uninstall and other issues. It was launched by Twitter, Twitter (the unofficial Chinese term Twitter) is a Web site for American social networking and micro-blogging services, and is the global Internet Bower fully referencing the NPM concept and implementation principles, so you'll see it used almost exactly the same as NPM. Bower is running on a node. js basis, so your current environment ensures that node. JS is already installed. Basic features: 1. Register the module: Each package needs to determine a unique ID so that the search and download can correctly match 2. File storage: Store the file on a valid network address and download it directly to. 3. Upload download: You can upload your package after registering for storage. You can use a command to download directly to the current project. 4. Since analysis: It helps us to solve the direct dependency of package and package. When we download a package A, because it depends on package B, Bower will automatically help us download the package B Bower will create a. Bower folder in the user's home directory, this folder will download all the resources, and install a software package so that they can be used offline. Every time you download any repository you will be installed in two folders-one in the application folder and the other in the user home directory. Bower folder. So the next time you need this repository, you'll use the version in the user's home directory. Bower. In order to install Bower, you first need to install the following files:
- Node: Download the latest version of node. js
- NPM:NPM is the node Package Manager. It's bundled in the Nodejs installer, so once you've installed the NODE,NPM, you're ready to install it.
- Git: You need to get some code packages from the Git repository.
Installation
sudo npm install-g Bower
Check
Bower Help
Update
NPM Update-g Bower
Common Commands
Cache:bower Cache Management Help: Displaying the bower command's helpful information home: Open a Package's GitHub publishing page via the browser info: View the information for the package init: Create Bower.json File Install: Installation package to Project Link: Set up a project link in the Local Bower Library list: List items installed Package Lookup: Query package based on package name Urlprune: Delete Item-independent Package Register: Register a package Search: Find package Update: Updates the package for the project uninstall: To delete a project's package
Under the specified directory, download a jquery file and specify a version
Bower Install jquery#1.7. 2 --save
--save is to write the downloaded package information to the configuration file's dependencies. Same as NPM. Let's look at the Bower.json file.
{ "name":"Test", "version":"0.0.1", "authors": [ "Shengyao <[email protected]>" ], "Main":"Main.js", "License":"MIT", "Ignore": [ "**/.*", "Node_modules", "bower_components", "app/bower_components", "Test", "tests" ], "Dependencies": { "jquery":"1.7.2" }}
Take a look at the jquery information
Bower Info jquery
View Dependencies
Bower List
Reference: http://bower.io/https://www.npmjs.com/http://git-scm.com/
Bower A Package Manager for the Web