O'Reilly logo

Beginning Node.js by Basarat Ali Syed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 5

image

Events and Streams

Before we examine specific areas of Node.js development, we need to address a few more core concepts about JavaScript in general and Node.js in particular. Node.js is focused on being the best-performing, simplest way to create server applications. Events and streams play an important role in achieving this goal.

Node.js is single-threaded; we have already discussed advantages of this fact. Due to this evented nature of Node.js, it has first-class support for an event subscription/unsubscription pattern. This pattern is very similar to the way you would handle events using JavaScript in the browser.

Streaming data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required