From the course: Advanced Node.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Logging concurrent tasks

Logging concurrent tasks - Node.js Tutorial

From the course: Advanced Node.js

Start my 1-month free trial

Logging concurrent tasks

- [Voice Over] In the last video, we created a promise queue. Let's set up a way to visualize this queue in the console. What I wanna do is install an NPM called log update. So I'm gonna come over here to the terminal and type NPM install log update. And what log update is gonna do is it's gonna allow us to keep the updates that we wanna log to the console in the same place. So they will over write each other as opposed to seeing continuous console logs scroll down our terminal. So I'm gonna come up here to line one, and I'm gonna make sure I import that. Log update equals require log update. So we'll use that to manage the console log. And then I'm gonna create another variable called to X. And what to X is gonna do is it's just going to return a capital X. So what we're gonna do is take every item in the queue and we're gonna represent it with a capital X. So I will use that to X function inside of my logs. So I'm gonna go ahead and create one more function inside of my promise…

Contents