Learn how Node operates in asynchronous way

Node acts strange - it makes calls in weird order

You've created the perfect empty Express.js web app stub and are starting to fill in logic around different routes. You code your program logic: check authorization, fire away a database query over to postgres and then render the results page. Everything should be all right. After testing, you realize that the page renders with zero results. Node never waited for the database call to finish before rendering the page.

This leaves you scratching your head. You thought it would work - it was supposed to. You feel like you have an idea of the cause, though. You've once again touched the mystical asynchronous nature of Node.js. And you're as confused as the last time you encountered strange and unexplainable behavior. You just don't get how things work in that world!

Reading examples doesn't lead to understanding

You've read tutorials and code samples on the net - there are plenty of them available. Copy & pasting snippets from Stack Overflow helps you get some things working, but when it comes to writing your own program logic things come to a screeching halt. You don't have a crystal clear picture of in which order callbacks execute - so you don't know where to put the right code line. Should you put it after the other call or inside a callback?

You would need to know exactly in which order callbacks are run for you to continue. But it feels like reading just examples doesn't lead to such understanding. Grasping the asynchronous nature of Node.js feels out of reach.

What if asynchronous code spoke to you

What if you knew exactly when callbacks are run. You'd be able to reason about code examples just by looking at them, not to mention coding your app. You'd be confidently expressing program logic in Node.js.

When you know how things work you'll be able to get into the flow of coding again. You'll know what buttons to push to get work done. You could even be the one telling others about the execution order of callbacks.

You've had your fair share of painfully scratching your head over the asynchronous nature of Node.js. There's a way to make it right and learn how to approach thinking Node.js programs.

With How Node works? you'll grasp the asynchronous nature of Node.js

It is possible to learn how Node.js operates and know exactly in which order callbacks execute. The inner workings are predictable and simple to understand once you zoom a few levels up from the level of individual statements and while loops. Looking at the whole system that operates when you return from a top level JavaScript block is the key to understanding the asynchronous nature of Node.js. That is exactly what you'll learn in How Node works?.

You'll learn through both examples and theoretical explanation. The book also presents the most common mistakes made in Node.js programming that relate to asynchronicity.

What you'll get out of the book

  • explanation of how things work under the hood
  • understanding of in which order callbacks run
  • a clear path from basics to more advanced concepts
  • a thinking model how to approach Node.js programs
  • explanations to most common mistakes
  • knowledge of process.nextTick, setImmediate, setTimeout
  • a refresher on JavaScript closures and anonymous functions

Get the book, crack open your editor, and you'll be writing Node apps with a new level of understanding!

Join Waiting List

cover

"Callback oriented programs look strange to people coming from traditional thread-oriented background."
- a JavaScript developer