Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jam vs Bower, what's the difference?

There are two package managers for client-side Javascript, but how do they compare? Could someone explain which one excels at what?

  • Jam
  • Bower
like image 924
NO WAR WITH RUSSIA Avatar asked Mar 24 '13 19:03

NO WAR WITH RUSSIA


2 Answers

As others mentioned in comments already there are a few alternatives in this space beyond just Jam and Bower.

  • Component
  • Ender
  • Volo

Both aim to provide a way to package up your assets and manage the dependencies between them for the client. Both Bower and Jam appear to have made their debut in 2012 -- Sept and May respectively.

Both are available through node/npm and if all you want to do is resolve dependencies between public libraries like backbone, underscore, jquery, etc. for your application then either solution will work and allow you some basic options to control version, where to put it in your project, and checking for updates.

As for what's different -- Bower is a bit lower level than Jam which makes it more usable to a wider audience. You can create bower components for more than just JavaScript libraries. Jam focuses more solely on AMD style JavaScript libraries. With Jam, you can specify your dependencies in the package.json file you would use with npm components already whereas Bower has chosen component.json by convention. The limitation with Bower is that it only fetches your dependencies, you still need a build system if you want to use Require.js or other solutions which Jam has chosen so you get for free. Bower is getting support from Twitter and a few other projects (Ender, Yeoman).

Apologies if this is incorrect, but one additional limitation of Jam is that it does not allow you to create your own components for distribution in a private repository. This is something Bower allows you to configure as an endpoint in .bowerrc but I have as yet found a way to do that in Jam. Perhaps I haven't searched well enough but it appears there is at least one fork for private-jam.

A few other good reads:

  • http://yeoman.io/packagemanager.html
  • http://dailyjs.com/2013/01/28/components/
like image 107
j12y Avatar answered Nov 15 '22 11:11

j12y


Using the following breakdown of some of the popular package managers you can decide what you want to use in you development. It compares factos as

  • whether the manager uses package.json or other form of descriptor
  • what features does it support (scaffolding, compilation, having central registry)
  • speed
  • form of packages support (js only, js and css, js html and css)
  • module types supported
  • and of course some notes based on personal point of view

https://github.com/wilmoore/frontend-packagers

like image 5
antitoxic Avatar answered Nov 15 '22 10:11

antitoxic