19

Do you know a package manager for web assets?

I'd like something that can download libraries such as jQuery so I can plug them into my asset pipeline. The js.* python packages for fanstatic are close, but they pick a single "latest" version of the library, which can lag a few releases behind.

Google's js cdn has the metadata for a few of them, but is mostly designed to be downloaded by the browser directly.

Tobu
  • 24,771
  • 4
  • 91
  • 98

5 Answers5

16

I've found these package managers for in-browser javascript:

Most of these can publish in the AMD format for browser loaders, and can be loaded by RequireJS. They also tend to use the CommonJS package format (also used by npm) for their package.json metadata.

I also found XStatic, which seems to be a less-active version of fanstatic, and like fanstatic wraps the libraries in Python packages. It has the same limitation (versions tend to lag), but writing a wrapper package seems simple enough that I can bake my own updates.

BPM and fanstatic are aware of non-js assets and can merge or minify CSS.

Tobu
  • 24,771
  • 4
  • 91
  • 98
  • 4
    I'd like to add [Jam](http://groundcomputing.co.uk/code/jam) as the latest addition to your list of JavaScript package managers. – Caolan Jun 21 '12 at 15:53
  • 1
    [Yeoman](http://addyosmani.com/blog/improved-developer-tooling-and-yeoman/) (yet to be released) also promises some package management in the form of bower (which apparently is by Twitter people and was very briefly availble on npm) – Tobu Jul 10 '12 at 16:48
  • Jam is IMO the best as it's respecting a requirejs compatible configuration and can easily be set up with a json file similar to the PHP package manager composer. – acme Sep 24 '12 at 14:57
14

Bower, the package manager, from Twitter.

Bower is a package manager for the web. Bower lets you easily install assets such as images, CSS and JavaScript, and manages dependencies for you.

Bower does package management and package management only.

Bower requires Node and npm (and possibly git for some bower packages). It is also included in Yeoman, a set of tools to help developers build modern web apps.

Gan
  • 4,827
  • 3
  • 34
  • 50
  • 1
    Bower is awesome. It's the npm of the client side (with fewer packages though). – wprl Dec 29 '12 at 15:12
  • 1
    -1 bower doesn't support commits and the devs don't seem to want to support it—say goodbye to 90% of the web that isn't the perfect snowflake bower wants it to be =/ they do more then happily support getting the last unstable changes though – srcspider Apr 02 '13 at 15:24
  • 1
    To add to srcspider's comment, in many cases bower is equivalent to doing `git clone` and `git checkout tagname` of the dependency. If the target requires anything more than this and doesn't have a bower config file in its repo it won't work. If the project requires a build process (eg Sinon) it won't work. If you want to use a specific branch or commit instead of a tag it won't work. – DriverDan May 22 '13 at 20:52
  • 4
    @GusDeCooL, what's wrong with nodejs? It answers the posted question just fine. – Gan Sep 17 '13 at 10:06
  • @Gan, Hi, sorry my bad. I tested bower. It seems only use nodejs for some of it library, but our downloaded front-end script can still work fine without nodejs. i already upvoted your answer :) – GusDeCooL Sep 17 '13 at 12:12
5

If you are on Visual Studio 2010, NuGet is best

http://nuget.org/

Alexander Beletsky
  • 19,453
  • 9
  • 63
  • 86
3

The author of RequireJS has also created a package / dependency manager called Volo:

Create browser-based, front-end projects from project templates, and add dependencies by fetching them from GitHub. Once your project is set up, automate common tasks.

volo is dependency manager and project creation tool that favors GitHub for the package repository.

At its heart, volo is a generic command runner -- you can create new commands for volo, and you can use commands others have created.

Boy Baukema
  • 2,908
  • 1
  • 27
  • 38
1

Just use npm. It has tons of browser modules in it already, and is way larger than the other options:

http://www.modulecounts.com/

Mikola
  • 9,176
  • 2
  • 34
  • 41