Chapter 1. Node Fundamentals
Node is an open source, cross-platform runtime environment in which developers can create backend services using the JavaScript language. It’s built on top of V8, the JavaScript engine of the Chrome web browser, and it has dozens of built-in modules that are designed to be used asynchronously with an event-driven approach that’s commonly known as the non-blocking model. Node developers can use events and handler functions to efficiently perform multiple operations in parallel, without having to deal with the complexity of multiple processes and threads.
There’s a lot to unpack here, and that’s what we will be doing in this first chapter. We’ll start with an introduction to Node, how it works, and why it’s popular. We’ll learn the basics of the Node CLI, how to use modules and packages, and how to perform synchronous and asynchronous operations. We’ll discuss the fundamentals of Node’s event-driven, non-blocking model and learn how callbacks, promises, and events can be used to handle the result of an asynchronous operation.
Note
Throughout the book, I use the term Node instead of Node.js for brevity. The official name of the runtime environment is Node.js, but referring to it as just Node is common.
Introducing Node
Ryan Dahl started the Node project in 2009 after he was inspired by the performance of the V8 JavaScript engine in the Google Chrome web browser. V8 uses an event-driven model, which makes it efficient at handling concurrent connections ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access