Promises and Generators
This module allows you to implement ES7's async/await pattern using ES6's yield.
This is @ForbesLindesay's async function from his Control Flow Utopia presentation. I was surprised to find out it apparently hadn't been packaged yet.
var seem = require'seem'; var g = seem var a = yield Promiseresolven+4; var b = yield Promiseresolvea+5; return b+3;;
The function will now return a Promise that will resolve to the value of the return statement upon success.
g2then assertresult === 2+4+5+3;
Essentially yield turns its Promise argument into that Promise's result.
Replace Promise.resolve with your preferred asynchronous operation for full power.