HNHacker News
TopNewBestAskShowJobs

caolanm

100 karma · joined January 17, 2011

http://caolanmcmahon.com
submissionscomments
caolanm··on Pithy.js - An internal DSL for generating HTML in JavaScript
Currently it generates a HTML string rather than DOM Elements but if it did it would be cool to be able to add onclick handlers etc in the attributes argument.
caolanm··on Jam - The JavaScript package manager
Yes, definitely. You shouldn't need to know anything about Node.js beyond installing it. Jam is for managing front-end code and would be useful in any application with a lot of client-side JavaScript.
caolanm··on Jam - The JavaScript package manager
You can call it JamJS if it makes you feel better ;) Obviously, I'd have preferred to avoid a naming conflict had I known about this project but it's getting pretty difficult to find unique names for JS projects these days. There's already a 'jam' in NPM!
caolanm··on Jam - The JavaScript package manager
Dependencies are installed locally to your project, but not for each package individually, if that makes sense. On the client-side you really don't want to be shipping 5 versions of jQuery! - I agree that it's an awesome way to do things for Node.js, but it just doesn't translate well to the browser.

As for package.json, yes there may occasionally be conflicts with NPM, but in many cases they should be compatible since they are based on the same spec. Perhaps allowing you to override with "jam.json" would be a good idea for times when they would conflict?

caolanm··on Nimble - a tiny functional js and async flow control library
The async lib will still be developed, and will aim to be as comprehensive as possible.

This library was created because I often include both async and underscore in client-side projects, which seems a bit overkill when every kb matters.

I've also looked into combining the features of async with underscore in the past. However, I don't believe its possible without backward incompatible changes, or a separate API (one for sync one for async). Nimble is an experiment in how a combined API might work, and uses some interesting tricks regarding function arity to support something closer to the standard map/filter/reduce, while still being convenient to use with callbacks.

For example, you can do the following:

_.map(arr, function (val, callback) { ... }, main_callback);

but you can also do this:

_.map(arr, function (val, key, arr, callback) { ... }, main_callback);

And it will still work as expected.

caolanm··on Nimble - a tiny functional js and async flow control library
Ok, it took me like 3 attempts to post this link, sorry if I spammed anyone :(
caolanm··on [dead]
I'm the author of the Async JavaScript library (http://github.com/caolan/async) and kept finding myself including it with the excellent Underscore.js for small and client-side projects.

This seemed like overkill, so I've made a tiny build with just the essentials from each library, and a new unified API. Perhaps some HN members will find this useful?