SlideShare a Scribd company logo
1 of 14
Download to read offline
Bower
a package manager by Twitter
Bower - introduction
● why another tool?
● common commands
● installing packages
● bower.json
● building custom scripts
● sources
Developing frontend now
Common workflow:
1. Go to jquery.com
2. Download jQuery
3. Find fancy plugin
4. Donwload it
5. Link scripts to page
6. Hoping for a miracle
... but I broke something,
WTF?
Common problems
● changing jQuery version to newer one,
but old code doesn't work with it - jQuery
do not change mayor version when bc
breaks occur.
● Plugin may require specific version, but
they don't write that in docs or I didn't
read it.
Standard view
My view
It is not about language,
it is about programmers.
Bower
● by Twitter
● dependency manager for frontend
● installing via npm
● version control
Bower - basic commands
> bower help
bower install
bower update
bower search
bower uninstall
bower list
Bower - package installing
> bower install jquery
> bower install modernizr#2.6.1
> bower install jquery/jquery-ui
> bower install ~/myCustomLib
> bower install http://example.com/lib.zip
Bower - common sources
● github
● http://sindresorhus.com/bower-components/
bower.json
{
"name": "my-project",
"version": "1.0.0",
"main": "path/to/main.css",
"ignore": [
"**/*.txt"
],
"dependencies": { ... }
}
Bower - saving dependencies
> bower install jquery/jquery#1.9.1 --save
{
"name": "js_lab",
"version": "0.0.0",
"dependencies": {
"jquery": "1.9.1"
}
}
Bower - .bowerrc
{
"directory": "bower_components",
"endpoint": "https://bower.mycompany.com",
"json": "bower.json",
"searchpath": [
"https://bower.herokuapp.com"
],
"shorthand_resolver": "git://example.com/{{{
organization }}}/{{{ package }}}.git"
}
Bower - sources
● http://bower.io/
● https://github.com/bower/bower

More Related Content

Viewers also liked

DevOps - from idea to production
DevOps - from idea to productionDevOps - from idea to production
DevOps - from idea to productionHabib MAALEM
 
NodeJS for Mobile App
NodeJS for Mobile AppNodeJS for Mobile App
NodeJS for Mobile AppHabib MAALEM
 
Quand utiliser MongoDB … Et quand vous en passer…
Quand utiliser MongoDB	… Et quand vous en passer…Quand utiliser MongoDB	… Et quand vous en passer…
Quand utiliser MongoDB … Et quand vous en passer…MongoDB
 
JavaScript dans l'usine logicielle
JavaScript dans l'usine logicielleJavaScript dans l'usine logicielle
JavaScript dans l'usine logiciellejollivetc
 
Node.js et MongoDB: Mongoose
Node.js et MongoDB: MongooseNode.js et MongoDB: Mongoose
Node.js et MongoDB: Mongoosejeromegn
 
Gérer son environnement de développement avec Docker
Gérer son environnement de développement avec DockerGérer son environnement de développement avec Docker
Gérer son environnement de développement avec DockerJulien Dubois
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
HTML5, Spring, NoSQL et mobilité
HTML5, Spring, NoSQL et mobilitéHTML5, Spring, NoSQL et mobilité
HTML5, Spring, NoSQL et mobilitéJulien Dubois
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficientlypostmanclient
 
Industrialisation Front-end - introduction
Industrialisation Front-end - introductionIndustrialisation Front-end - introduction
Industrialisation Front-end - introductionhalleck45
 

Viewers also liked (15)

gulp-techdencias
gulp-techdenciasgulp-techdencias
gulp-techdencias
 
DevOps - from idea to production
DevOps - from idea to productionDevOps - from idea to production
DevOps - from idea to production
 
NodeJS for Mobile App
NodeJS for Mobile AppNodeJS for Mobile App
NodeJS for Mobile App
 
Node.js
Node.jsNode.js
Node.js
 
Quand utiliser MongoDB … Et quand vous en passer…
Quand utiliser MongoDB	… Et quand vous en passer…Quand utiliser MongoDB	… Et quand vous en passer…
Quand utiliser MongoDB … Et quand vous en passer…
 
JavaScript dans l'usine logicielle
JavaScript dans l'usine logicielleJavaScript dans l'usine logicielle
JavaScript dans l'usine logicielle
 
Automatización de tareas con Gulp
Automatización de tareas con GulpAutomatización de tareas con Gulp
Automatización de tareas con Gulp
 
Node.js et MongoDB: Mongoose
Node.js et MongoDB: MongooseNode.js et MongoDB: Mongoose
Node.js et MongoDB: Mongoose
 
Gérer son environnement de développement avec Docker
Gérer son environnement de développement avec DockerGérer son environnement de développement avec Docker
Gérer son environnement de développement avec Docker
 
De Devoxx au CAC40
De Devoxx au CAC40De Devoxx au CAC40
De Devoxx au CAC40
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
HTML5, Spring, NoSQL et mobilité
HTML5, Spring, NoSQL et mobilitéHTML5, Spring, NoSQL et mobilité
HTML5, Spring, NoSQL et mobilité
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 
Industrialisation Front-end - introduction
Industrialisation Front-end - introductionIndustrialisation Front-end - introduction
Industrialisation Front-end - introduction
 

Bower

  • 2. Bower - introduction ● why another tool? ● common commands ● installing packages ● bower.json ● building custom scripts ● sources
  • 3. Developing frontend now Common workflow: 1. Go to jquery.com 2. Download jQuery 3. Find fancy plugin 4. Donwload it 5. Link scripts to page 6. Hoping for a miracle ... but I broke something, WTF?
  • 4. Common problems ● changing jQuery version to newer one, but old code doesn't work with it - jQuery do not change mayor version when bc breaks occur. ● Plugin may require specific version, but they don't write that in docs or I didn't read it.
  • 6. My view It is not about language, it is about programmers.
  • 7. Bower ● by Twitter ● dependency manager for frontend ● installing via npm ● version control
  • 8. Bower - basic commands > bower help bower install bower update bower search bower uninstall bower list
  • 9. Bower - package installing > bower install jquery > bower install modernizr#2.6.1 > bower install jquery/jquery-ui > bower install ~/myCustomLib > bower install http://example.com/lib.zip
  • 10. Bower - common sources ● github ● http://sindresorhus.com/bower-components/
  • 11. bower.json { "name": "my-project", "version": "1.0.0", "main": "path/to/main.css", "ignore": [ "**/*.txt" ], "dependencies": { ... } }
  • 12. Bower - saving dependencies > bower install jquery/jquery#1.9.1 --save { "name": "js_lab", "version": "0.0.0", "dependencies": { "jquery": "1.9.1" } }
  • 13. Bower - .bowerrc { "directory": "bower_components", "endpoint": "https://bower.mycompany.com", "json": "bower.json", "searchpath": [ "https://bower.herokuapp.com" ], "shorthand_resolver": "git://example.com/{{{ organization }}}/{{{ package }}}.git" }
  • 14. Bower - sources ● http://bower.io/ ● https://github.com/bower/bower