Master asynchronous calls and write programs that do what you intended
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:
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.
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 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
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.
The key to writing programs that do what you want is to understand how Node works. The internals of Node are predictable when you zoom out from the level of individual statements and for-loops. When you look at the system that takes over when you return from a top-level function you’ll start to understand how calls get executed.
When you understand what takes place behind the scenes you get the right mental model on how to write Node programs. And that is exactly what you’ll learn in this book. You’ll learn
Theory alone is not enough if you don’t get to practice your newly learned skills. Therefore you’ll be writing five programs as exercise assignments. You get to build a news aggregator and a Twitter bot, call weather APIs and cryptographic hash functions.
The book is written in a concise form that is perfect for busy developers who don’t have too much spare time on their hands. You can download the table of contents and two sample chapters (here).
What You Need to Know to Write Your First App
Returning Control Back
Visualizing Program Execution
Putting Dependent Logic Inside Callback
Making Use of Waiting Time
Bonus: Caring for Other Computations
Bonus: Complete System
No. This book is for learning asynchronous calls and the operating principles at the heart of Node. The book uses callbacks and plain Node. Learning async-library, Promises, generators and async/await is recommended after reading this book and is much easier after you've mastered the basics.