Native Support for Promises in Node.js

Although Node.js added native promise in stable version 0.12.

But due to the memory leak issue, I recommend to use bluebird to avoid the issue.

  • https://github.com/promises-aplus/promises-spec/issues/179
  • https://github.com/tj/co/issues/180

Old anwser:

Node.js added native promise support since version 0.11.13.

nvm install 0.11.12
nvm run 0.11.12
> Promise
ReferenceError: Promise is not defined
> console.log(process.versions.v8)
3.22.24.19

nvm install 0.11.13
nvm run 0.11.13
> Promise
[Function: Promise]
> console.log(process.versions.v8)
3.25.30

Note: Node.js v0.11 is still in beta, be careful if use it in production.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)