#!/usr/local/bin/node function delayHello() { var d = new $.Deferred(); setTimeout(function(){ console.log('Hello!'); d.resolve(); }, 1000); return d.promise(); } delayHello() .then(delayHello) .then(delayHello) .then(delayHello) .then(delayHello);