January 2018
Beginner
658 pages
13h 10m
English
Now that we have a very basic promise example in place, let's run it from the Terminal using nodemon, which we installed in the previous chapter. We'll add nodemon, and then we'll go into the playground folder, /promise.js:

When we do this right away, our app runs and we get success. Hey. It worked! This happens instantaneously. There was no delay because we haven't done anything asynchronously. Now when we first explored callbacks (refer to Chapter 5, Basics of Asynchronous Programming in Node.js ), we used setTimeout to simulate a delay, and this is exactly what we'll do in this case.
Inside our
Read now
Unlock full access