As browsers and HTML have matured, our ability to create wonderful experiences has become easier and better, but our code has become more complex. To aid this complex development, we rely on packages such as JQuery, Bootstrap, etc.
But with the use of packages comes the need for package and dependency management. Ruby has RubyGems and Node.js has NPM, but we also need something for the browser. Here are a few of the more popular choices and how they approach dependency/package management.
Bower – A Package Manager for the Web
I find the configuration of Bower to be simple and very similar, compared to other package management systems I’ve used before. There are a large number of components available for Bower, and they’re easily discoverable. For simple projects, this seems like a really good fit that will stay out of your way and allow you to load and work with packages how you want.
RequireJS builds on top of the Asynchronous Module Definition (AMD), allowing a simple interface to take advantage of that technology. RequireJS does not appear to provide a set of packages, but is instead just a way to load packages that you get either through NPM or Jam.
RequireJS has a great interface for loading modules and would be a great fit for a large project with lots of dependencies. Especially for areas where optimization is crucial.
Jam – Putting the Browser First
Jam provides a command line way to find and download packages that can then be loaded via RequireJS. Jam can also be configured with a json file, like Bower, allowing you to define packages, versions, and dependencies.
Browserify – Require Modules in the Browser