Yes async-await is supported in Node.js v7 but its locked behind the harmony
flag. Features which are not yet production ready are behind this flag.
To use async-await in Node.js v7 simply run Node service with this flag -
node --harmony-async-await app.js
The official release of async-await is slated for Node.js v8 which will be launched in April.
You can follow this pull request to check its status. Basically the correct functioning of async-await is dependent on the integration of V8 engine v5.5 into Node.js. Currently Node.js uses V8 v5.4 which is solved by this pull request.
Update 1 - It seems V8 v5.5 might be coming to Node.js v7. Follow this pull request for more details.
Update 2 - Good news guys! Node.js version 7.6.0 now officially supports async
functions without using the --harmony
flag as V8 engine 5.5 has been successfully ported.
Now you only need to use the --harmony
flag if your Node.js version is between 7.0 to 7.5.0 (inclusive). For complete changelog refer here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…