Q lazy promise resolution
Resolves promises idly.
npm install q-lazy
It's a simple plugin for Q allowing you to create lazy
promises. Such promises start to resolve only after calling
.then() on them.
var Q = require'q';require'q-lazy'; // extends Q// ...return ret; // the return value can be a promise or a plain valuevar promise = QlazyheavyFunc; // doesn't execute heavyFuncpromisethen // executes heavyFunc// use ret;
For specification take a look at provided testsuite. It's short.