Bower is a package manager for the web. It 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.).

A URL to a file, including zip and tar files. Its contents will be
extracted.

‡ These types of <package> might have versions available. You can specify a
semver compatible version to fetch a specific release, and lock the
package to that version. You can also use ranges to specify a range of versions.

All package contents are installed in the bower_components directory by default.
You should never directly modify the contents of this directory.

Using bower-auth list will show all the packages that are installed locally.

N.B. If you aren't authoring a package that is intended to be consumed by
others (e.g., you're building a web app), you should always check installed
packages into source control.

The easiest approach is to use Bower statically, just reference the package's
installed components manually using a script tag:

<scriptsrc="/bower_components/jquery/index.js"></script>

For more complex projects, you'll probably want to concatenate your scripts or
use a module loader. Bower is just a package manager, but there are plenty of
other tools -- such as Sprockets
and RequireJS -- that will help you do this.

Your package must be available at a Git endpoint (e.g., GitHub); remember
to push your Git tags!

Then use the following command:

bower-auth register <my-package-name> <git-endpoint>

The Bower registry does not have authentication or user management at this point
in time. It's on a first come, first served basis. Think of it like a URL
shortener. Now anyone can run bower-auth install <my-package-name>, and get your
library installed.

You must create a bower.json in your project's root, and specify all of its
dependencies. This is similar to Node's package.json, or Ruby's Gemfile,
and is useful for locking down a project's dependencies.

NOTE: In versions of Bower before 0.9.0 the package metadata file was called
component.json rather than bower.json. This has changed to avoid a name
clash with another tool. You can still use component.json for now but it is
deprecated and the automatic fallback is likely to be removed in an upcoming
release.

Bower provides a powerful, programmatic API. All commands can be accessed
through the bower.commands object.

var bower =require('bower-auth');

bower.commands

.install(['jquery'],{ save:true},{/* custom config */})

.on('end',function(installed){

console.log(installed);

});

bower.commands

.search('jquery',{})

.on('end',function(results){

console.log(results);

});

Commands emit four types of events: log, prompt, end, error.

log is emitted to report the state/progress of the command.

prompt is emitted whenever the user needs to be prompted.

error will only be emitted if something goes wrong.

end is emitted when the command successfully ends.

For a better of idea how this works, you may want to check out our bin
file.

When using bower programmatically, prompting is disabled by default. Though you can enable it when calling commands with interactive: true in the config.
This requires you to listen for the prompt event and handle the prompting yourself. The easiest way is to use the inquirer npm module like so:

To use Bower on Windows, you must install
msysgit correctly. Be sure to check the
option 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.