Chapter 1. Welcome to Node.js


This chapter covers

  • What Node.js is
  • JavaScript on the server
  • The asynchronous and evented nature of Node
  • Types of applications Node is designed for
  • Sample Node programs

So what is Node.js? It’s likely you’ve heard the term. Maybe you already use Node. Maybe you’re curious about it. At this point in time, Node is very popular and young (it debuted in 2009). It’s the second-most-watched project on GitHub (, it has quite a following in its Google group ( and IRC channel (, and it has more than 15,000 community modules published in NPM, the package manager ( All this to say, there’s considerable traction behind this platform.

Ryan Dahl on Node

You can watch the first presentation on Node by creator Ryan Dahl on the JSCONF Berlin 2009 website:

The official website ( defines Node as “a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.”

In this chapter, we’ll look at these concepts:

1.1. Built on JavaScript

1.2. Asynchronous and evented: the browser

1.3. Asynchronous and evented: the server

1.4. DIRTy applications

1.5. DIRTy by default

1.6. Summary