Inspired by angular's $q service, a q/promise library for node.
Install the module with: npm install q-ng
var Q = require('q-ng');
function testQ(value) {
var deferred = Q.defer();
setTimeout(function(){
deferred.resolve(value);
}, 1000);
return deferred.promise();
}
testQ(5)
.then(function(value){
console.log(value);
});
// this outputs: 5
(Coming soon)
(Coming soon)
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
(Nothing yet)
Copyright (c) 2014 Md Kamrul Islam Licensed under the MIT license.