Join Alexander Zanfir for an in-depth discussion in this video What are callbacks?, part of Learning Node.js.
- Let's take a look at callbacks in more detail.…There are several ways to understand or look at callbacks.…I will be using the async-demo.js from the exercise files…for this video.…There are several ways to understand or look at callbacks.…Let's start with one way.…Just a quick analogy, let's imagine you're having…problems with your internet provider…and your internet is down.…You call your provider on the phone…and as usual, you're put on hold,…and are waiting for the next available agent.…Now if you continue to hold you might waste the next…10 to 20 minutes and that's kind of like…synchronous code.…
You're just waiting and your life is put on hold…for that amount of time.…With a callback, you can just hang up…and carry on with the rest of your life…and you'll get a call once an agent frees up.…So, back in our code, let's use that analogy.…It's as if we are calling readdir, and telling it,…when you're done doing this task,…or when one of your agents frees up…and is available to talk with me or give me the…information from readdir, call me back at this number.…
- Installing Node.js
- Writing modules and packages
- Reading and writing files
- Working with frameworks: Express, Sails, and Koa
- Generating promises
- Working with generator functions
Skill Level Beginner
Q: When I try to install Bluebird/Express/Gulp/Sails/KOA using the Node Package Manager, it seems to install correctly in the terminal. But why doesn't my project folder change?
A: You need to make sure that you've navigated to your project folder in the terminal. For example, in this course Alexander is working from the C:\Dev\ folder both in Brackets and in the terminal.