Chapter 1. Node.js Design Fundamentals

Some principles and design patterns literally define the Node.js platform and its ecosystem; the most peculiar ones are probably its asynchronous nature and its programming style that makes heavy use of callbacks. However, there are other fundamental components that characterize the platform; for example, its module system, which allows multiple versions of the same dependency to coexist in an application, and the observer pattern, implemented by the EventEmitter class, which perfectly complements callbacks when dealing with asynchronous code. It's therefore important that we first dive into these fundamental principles and patterns, not only for writing correct code, but also to be able to take effective ...

Get Node.js Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.