Support for ES6 Promise?


I’m not sure how the Chromium fork and Node are packaged into Atom, so I don’t know how easy this is, but:

In Chrome 36 on my desktop, I have Enable Experimental JavaScript set under chrome://flags/, and so in the console, I can see that Promise is present just like other abstractions new in ES6 such as Set. In Atom, I see Set but not Promise.

Is it hard to get Promise in Atom and/or is there some way that I can already do this today?


I’m not an expert on Promises, but it is my understanding that the Q library is commonly used in Atom for Promise functionality. Perhaps @abe or @mark_hahn can elaborate.


Thanks for that. That’s a pretty good article.


The native Promise will be available in Atom 0.121.0 since Atom has been upgraded to Chrome 36


I built from HEAD and see it there now: thanks @kevinsawicki!


@kevinsawicki What’s the minimum version of Node that I need to use Promises? And what flags do I need to pass? I have v0.10.29 and am passing --harmony, but no dice.


@bolinfest: I’m not sure I understand why you need Promise in node if ultimately you intend to run you code in Atom, but anyway, you won’t get Promise in node with a version < 0.11.13, see:


Atom is 99% sync since multiple users aren’t typing at the same time. (grin)


@abe I was putting together a demo/repro case for an async/await transpiler, so I needed to use a Promise and was hoping to avoid require('promise'), if possible. Once this bug is fixed in regenerator, I’ll put together some steps on how best to write in futuristic JS for Atom today.