Node.js Async/Await

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Async/await is a set of keywords that allows writing of asynchronous code in a procedural manner without having to rely on callbacks (callback hell) or promise-chaining (.then().then().then()).

This works by using the await keyword to suspend the state of an async function, until the resolution of a promise, and using the async keyword to declare such async functions, which return a promise.

Async/await is available from node.js 8 by default or 7 using the flag --harmony-async-await.



Got any Node.js Question?