Hugo Josefson
Senior Web Consultant at www.jayway.com
"A package manager, by Twitter"
"Component package manager for
building a better web"-- TJ Holowaychuk
$ npm -g install bower
$ npm -g install component
Package management
Package management
Build tool
jquery
← no namespace!
someone/some-package
(defaults to GitHub)
zip
and tar.gz
will be
extracted)
someone/some-package
(defaults to GitHub)bower.json
bower.json
is optional
component.json
// my-component/index.js
module.exports = function MyComponent(args) {
var dep1 = require("dependency1");
dep1(args);
};
$ bower install
$ make # actually `component install`
git clone
dependency's git repo, into local cache→ Slow first time, then fast
component.json
from github→ Always fast
<script src="bower_components/dependency1/index.js"/>
<script src="bower_components/dependency2/index.js"/>
<script src="bower_components/dependency3/index.js"/>
<script src="bower_components/dependency4/index.js"/>
$ make # actually `component build`
<script src="build/build.js"/>
2500+ packages registered
Recommended by yeoman, others
1000+ components listed
<script/>
tag
By Hugo Josefson
Comparison between Component.js and Bower