tran then.js to coffee style