Native Support for Promises in Node.js

前端 未结 8 647
陌清茗
陌清茗 2020-12-13 23:29

Is there native support for promises in current versions of Node.js?

Node.js uses the V8 engine. This JavaScript engine is also used by Chrome, and Chrome 32 has na

8条回答
  •  死守一世寂寞
    2020-12-14 00:17

    I know it has been quite a long time since OP made this post, but I wanted to update those that are still managing to find this question through search.

    Node.js added native support for Promises since it merged with io.js. This happened on September 8, 2015 (as per this news post on the official Node.js site) with the first stable release of Node v4.0.0.

    A host of new ES6 features, such as Promises, were added with version 4. You can read more about them here.

    EDIT: Of note, it appears as though Bluebird's Promise performs better than the native implementation of Promise.

提交回复
热议问题