Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Dojo deferreds as a nodejs module - Work in Progress
Latest commit 5c6198c @felixge More README
Failed to load latest commit information.
lib Unit tests for DeferredGroup
test Unit tests for DeferredGroup More README

Dojo deferreds as a nodejs module

This is a port of dojo.Deferred to node.js. I am also working on DeferredGroup, an elegant wrapper to execute several Deferreds an parallel and aggregate the results.


So far this Deferred port has been altered in 1 major way. By default, dojo Deferreds execute every callback function in a try..catch block. This implementation does not. I think it is a bad idea to have this the default behavior as it will cause people countless hours of debugging since there will be no automatic feedback on their exceptions.

If you want to use the try..catch mechanism for callbacks, you have to specify it like this:

var d = new Deferred();
  .addCallback(function() {
    throw new Error("catchme");
  .addErrback(function(e) {
    // e.message == "catchme"


The addErrback is not needed for this example to work, but it shows you how to handle the exception trigger in the initial callback.


  • Unit tests
  • Re-factor code to my liking
  • Docs for DeferredGroup
Something went wrong with that request. Please try again.