Why can't I use Promise in node v0.11.11?

I just messed around with the v0.11 node branch, and I wonder why I cannot use my own ES6 Promise object, even when --harmony turned --harmony .

My regular chrome browsers:

 Google Chrome 32.0.1700.77 (Official Build 244503) JavaScript V8 3.22.24.10 

Supports them, and node.js v0.11.11 tells me:

 > process.versions.v8 '3.22.24.19' 

So what gives?

+7
javascript promise
source share
1 answer

Native Promises are located, you can use them. They are still slower and harder to debug than libraries like Bluebird, but they are.


Promises DOM Futures is currently in Chrome. They are also very experimental, and the API may change (it is discussed quite actively by atm).

Consider using Bluebird instead, as they are faster, have better stack traces, and are stable .

This is significantly faster than libraries such as Q (two orders of magnitude faster), it has much better stack traces and is fully compatible with the API. Of course, you can also compile node and v8 - Promises in v8 itself .

There are Promises in ES6, they aren’t "settled" yet - they make Chrome people get too angry

They are also considered part of the DOM because future DOM APIs will use promises.

+10
source share

All Articles