O'Reilly logo

Sams Teach Yourself Node.js in 24 Hours by George Ornbo

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

Hour 18. The Events Module

What You’ll Learn in This Hour:

• Using the Events module

• Emitting and listening for events

• How the Events module works with network programming

• Adding and removing events dynamically

Understanding Events

As you have learned, Node.js is opinionated about the best way to approach concurrency. It suggests that using an event loop (sometimes referred to as an event queue) is an efficient way to support asynchronous code and address the issue of concurrency. For developers coming from procedural, imperative languages this can be a paradigm shift, and many developers refer to programming around events as “programming inside out.”

The Events module is central to Node.js, and many other modules use it to structure ...

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