Bower

Web包管理器。(A package manager for the web.)

Github星跟踪图

Bower为前端软件包管理的问题提供了通用的、无限制的解决方案,同时通过API可以显示软件包依赖关系模型,该API可以被一个更固执己见的构建堆栈使用。 没有系统的依赖关系,不同应用之间没有依赖关系,依赖关系树是平的。

Bower在Git上运行,而且是与包无关的。封装的组件可以由任何类型的资源组成,并且使用任何类型的传输(例如,AMD,CommonJS等)。
网站是由很多东西组成的 - 框架,库,资源和实用程序。Bower帮你管理所有这些东西。
跟踪所有这些包,并确保它们是最新的(或设置为您需要的特定版本)是棘手的。Bower来拯救!
Bower可以管理包含HTML、CSS、JavaScript、字体甚至图像文件的组件。 Bower不会连接或缩小代码或执行任何其他操作 —— 只需安装所需软件包及其依赖关系的正确版本。
要开始使用,Bower通过从各处获取和安装软件包,照顾寻找、查找、下载和保存您要查找的内容。 Bower在清单文件bower.json中跟踪这些包。如何使用软件包取决于您。 Bower提供钩子,以便于在工具和工作流程中使用包。
Bower针对前端进行了优化。如果多个包依赖于一个包 —— 例如jQuery,Bower将只下载jQuery一次。这被称为平面依赖图,它有助于减少页面加载。
安装
$npm install -g bower

Bower依赖于Node.js和npm。 还要确保git已安装,因为某些Bower包需要取出并安装。

主要指标

概览
名称与所有者bower/bower
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2012-09-07 00:15:39
推送于2024-10-13 10:45:05
最后一次提交2024-10-13 13:45:04
发布数114
最新版本名称1.8.14 (发布于 2022-03-14 16:38:57)
第一版名称v0.1.1 (发布于 2012-09-16 14:20:17)
用户参与
星数15k
关注者数706
派生数1.8k
提交数2.8k
已启用问题?
问题数1925
打开的问题数9
拉请求数347
打开的拉请求数4
关闭的拉请求数328
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

Bower - A package manager for the web

Backers on Open Collective
Sponsors on Open Collective

..psst! While Bower is maintained, we recommend yarn and webpack or parcel for new front-end projects!

Unix CI
Windows CI
Coverage Status
Discord chat


Bower offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.

Bower runs over Git, and is package-agnostic. A packaged component can be made up of any type of asset, and use any type of transport (e.g., AMD, CommonJS, etc.).

View complete docs on bower.io

View all packages available through Bower's registry.

Install

$ npm install -g bower

Bower depends on Node.js and npm. Also make sure that git is installed as some bower
packages require it to be fetched and installed.

Usage

See complete command line reference at bower.io/docs/api/

Installing packages and dependencies

# install dependencies listed in bower.json
$ bower install

# install a package and add it to bower.json
$ bower install <package> --save

# install specific version of a package and add it to bower.json
$ bower install <package>#<version> --save

Using packages

We discourage using bower components statically for performance and security reasons (if component has an upload.php file that is not ignored, that can be easily exploited to do malicious stuff).

The best approach is to process components installed by bower with build tool (like Grunt or gulp), and serve them concatenated or using a module loader (like RequireJS).

Uninstalling packages

To uninstall a locally installed package:

$ bower uninstall <package-name>

prezto and oh-my-zsh users

On prezto or oh-my-zsh, do not forget to alias bower='noglob bower' or bower install jquery\#1.9.1

Never run Bower with sudo

Bower is a user command; there is no need to execute it with superuser permissions.

Windows users

To use Bower on Windows, you must install
Git for Windows correctly. Be sure to check the
options shown below:

Note that if you use TortoiseGit and if Bower keeps asking for your SSH
password, you should add the following environment variable: GIT_SSH - C:\Program Files\TortoiseGit\bin\TortoisePlink.exe. Adjust the TortoisePlink
path if needed.

Ubuntu users

To use Bower on Ubuntu, you might need to link nodejs executable to node:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Configuration

Bower can be configured using JSON in a .bowerrc file. Read over available options at bower.io/docs/config.

Support

Contributing

We welcome contributions of all kinds from anyone. Please take a moment to review the guidelines for contributing.

Note that on Windows for tests to pass you need to configure Git before cloning:

git config --global core.autocrlf input

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]




































Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]





























































License

Copyright (c) 2012-present Twitter and other contributors

Licensed under the MIT License