Using Express (for node.js)
How do I write a response after a callback?
The following is a minimal example. posix.cat is a function that returns a promise, up does something to the result, and I want to send that as the response.
require.paths.unshift('lib');
require('express');
var posix = require('posix');
get('/', function () {
...
I'm reading this article and the section on the promise abstraction seems a little overly complicated to me. The following is given as an example:
requestSomeData("http://example.com/foo") // returns a promise for the response
.then(function(response){ // ‘then’ is used to provide a promise handler
return JSON.parse(respons...
I'm really interested in implementing Promises and related features in client-side Javascript. From what I've seen, the focus in implementing these technologies in Javascript seems to be on server-side javascript (SSJS) with Promises in CommonJS. Ideally for me, I would find a solution that works well with jQuery or Google Closure Librar...