Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 2.78 KB

index.md

File metadata and controls

68 lines (44 loc) · 2.78 KB
title layout is_home
Bower
default
true

Web sites are made of lots of things — frameworks, libraries, assets, utilities, and rainbows. Bower manages all these things for you.

Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you're looking for. Bower keeps track of these packages in a manifest file, bower.json. How you use packages is up to you. Bower provides hooks to facilitate using packages in your tools and workflows.

Bower is optimized for the front-end. Bower uses a flat dependency tree, requiring only one version for each package, reducing page load to a minimum.

Install Bower

Bower is a command line utility. Install it with npm.

{% highlight bash %} $ npm install -g bower {% endhighlight %}

Bower requires node, npm and git.

For troubleshooting installation on different platforms, read the troubleshooting wiki page.

Getting started

Install packages

Install packages with bower install. Bower installs packages to bower_components/.

{% highlight bash %} $ bower install {% endhighlight %}

A package can be a GitHub shorthand, a Git endpoint, a URL, and more. Read more about bower install.

{% highlight bash %}

registered package

$ bower install jquery

GitHub shorthand

$ bower install desandro/masonry

Git endpoint

$ bower install git://github.com/user/package.git

URL

$ bower install http://example.com/script.js {% endhighlight %}

Search packages

Search Bower packages and find the registered package names for your favorite projects.

Save packages

Save your packages to bower.json with bower init.

Use packages

How you use packages is up to you. We recommend you use Bower together with Grunt, RequireJS, Yeoman, and lots of other tools or build your own workflow with the API. You can also use the installed packages directly, like this, in the case of jquery:

{% highlight html %}

<script src="bower_components/jquery/dist/jquery.min.js"></script>

{% endhighlight %}

Twitter updates from @bower

Tweets by @bower

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>