A package manager for web assets
Asked Answered
M

5

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.

Mechanize answered 8/9, 2011 at 10:39 Comment(0)
M
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.

Mechanize answered 13/9, 2011 at 12:2 Comment(3)
I'd like to add Jam as the latest addition to your list of JavaScript package managers.Kaunas
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)Mechanize
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.Jackfish
C
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.

Commutation answered 27/11, 2012 at 4:29 Comment(5)
Bower is awesome. It's the npm of the client side (with fewer packages though).Lafave
-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 thoughGerhan
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.Hemlock
@GusDeCooL, what's wrong with nodejs? It answers the posted question just fine.Commutation
@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 :)Cockswain
C
5

If you are on Visual Studio 2010, NuGet is best

http://nuget.org/

Classy answered 8/9, 2011 at 11:4 Comment(0)
H
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.

Husbandry answered 6/2, 2013 at 15:27 Comment(0)
M
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/

Merchandise answered 8/4, 2013 at 15:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.