Write Asynchronous Programs

Take Course

Master asynchronous calls and
write Node.js programs that do what you intended

After five rewrites your Node program still doesn’t do what you want!

You know how frustrating it is to try to make your Node program do what you want. The code you’ve written has no syntax errors, but running it has strange behavior like:

  • Node doesn’t wait for your database call to finish
  • your variable is undefined
  • your HTTP calls fire at the same time, not after each other like you intended

You’re supposed to “think asynchronously” when programming in Node but it’s not exactly clear how to accomplish this. The best you can do is mimick code seen in tutorials and hope it’ll just work. And when it doesn’t work, you have no clue how to take control of the scary looking code full of callbacks.

Asynchronous call tree

Information is scattered across blogs and GitHub issues

Trying to find focumentation is discouraging. How come the official docs at nodejs.org have no word on how you’re supposed to program Node? Looks like the real information is scattered across blogs, Github issues and Stack Overflow answers. That route seems to take forever and you don’t even know where to start.

You know it’s possible to make real-world Node apps, there’s plenty of existing projects out there, but you’re just not able to pull it off yourself.

What if you could turn the plan in your head into working program?

What if you were able to take the vision in your head and turn it into a working and running program. Imagine knowing exactly which statement to write next. You’d be the one in control of your app. You’d write programs that

  • finish database calls and only then continue further processing
  • have variables filled with values every time you need them
  • have HTTP calls that run one at a time

You’d be able to express program logic in Node.js. Every statement in your program would have a reason to exist. Time spent working on your app would go to implementing new features.

It’s true asynchronous calls are a little hard to grasp but it’s possible to make your text editor the place where working programs are created.

Learn to write programs that do what you intended

The operating principles of Node are simple and straightforward when you zoom out from the level of individual statements and for-loops. When you focus on the system that operates outside user code, you'll grasp the right mental model for writing Node programs.

Looking at the whole system that operates when you return from a top level JavaScript block is the key to “getting” Node. And that’s exactly what you'll learn in this course.

Learn the right mental model for Node apps

Knowing exactly what happens when you return from a top level JavaScript function is comforting. As a result, you'll write programs that work the system.

A clear mental model allows you to approach Node programs the right way. The course shows you a glimpse of the engine room while still keeping Kernighan & Ritchie on the bookshelf.

Theory-only courses are long gone, and in this course, you'll get to practice your new skills early on. In fact, you’ll be writing your first app in 30 minutes. Home assignments include meaningful programs such as a stress relief exercise, an MD5 file hasher, a Twitter bot, and a news aggregator.

You’ll learn

  • the execution model of Node that’s based on events and associated pieces of JavaScript
  • the triad that’s the role of a Node programmer - to start operations, register callbacks and let control back
  • to read asynchronous code and see the execution order of code lines
  • mental model for node operation
  • when callbacks are run
  • nextTick, setImmediate,
  • caring for other computations
  • and much more

When you're in control of your Node app, each statement you write has a reason to exist.

Learn asynchronous calls and turn the plan in your head into a working program.

Asynchronous call tree
  • 3-Week Email Course
  • 21 Lessons
  • 5 Home Assignments
  • All-in-one PDF
  • Source Code ZIP



Course Contents

  • mental model how to approach writing Node programs
  • system outside of user code
  • timers, setTimeout()
  • 🏆 Breathing Relaxation App
  • system calls initial user code
  • pseudo-code of the system
  • 🏆 Common Stack Overflow Question
  • knows callbacks are not run in parallel
  • can read files
  • asynchronous call starts immediately and returns without results
  • function is called when results are in
  • can use error argument
  • 🏆 MD5 File Hasher
  • can use streams
  • can calculate hashes
  • can read asynchronous code
  • knows difference between function arguments passed to forEach() and setTimeout()
  • can visualize program execution and outstanding operations
  • can put dependent logic inside callback
  • can make HTTP calls
  • 🏆 Twitter Weather Bot
  • can make use of waiting time
  • can start multiple calls right away or after each other
  • knows about worker threads
  • 🏆 News Aggregator
  • can care for other computations
  • can use setImmediate()
  • 🏆 Prime Number Calculator
  • knows about externalizing cpu-heavy calculation to own process
  • knows about process.nextTick()
  • knows in detail how the system outside user code operates

Q & A

Should I know JavaScript before taking the course?

You should know entry level JavaScript and have some previous experience in programming. You don't need in-depth experience with Node. All advanced Node topics are introduced with links to additional material.

Do you offer refunds?

Yes. If you're not happy with the course, hit us an email within 30 days and you'll get a full refund.

Does the course teach async-library, Promises, generators or async/await?

No. This course is for learning the operating principles behind Node.js. We'll use callbacks and plain Node. Learning async-library, Promises, generators and async/await is much easier after you've learned the basics, though.

Does the course use ES6?

The examples use ES5 version of JavaScript. ES6 is worth learning, but you should learn only one new thing at a time so the course sticks to ES5.

How much time should I allocate for the course?

You should allocate 30-60 minutes a day for the course. Each lesson is bite-sized in length and is digestible in one session.

How long does it take to finish the course?

If you submit each homework assignments within a few days, you'll finish the course in three weeks.

Can I work at my own pace?

The course pauses on homework assignments, and you can take as long as you need. The course continues when you submit your answer.

What format is the course in?

The course is delivered through email. You'll receive one email a day. And at the end, you'll have access to all-in-one PDF with all the lessons and a ZIP of all source code.

Are the exercises mandatory?

Yes. The course pauses until you submit your answer. The answers are kept private and are first and foremost for yourself.

Get a free sample lesson and a short e-mail course on Node asynchronicity

Success! Now check your email.

Oops! Something went wrong.