Wiring plugins

The dream architecture of a software engineer is the one having a small, minimal core, extensible as needed through the use of plugins. Unfortunately, this is not always easy to obtain, since most of the time it has a cost in terms of time, resources, and complexity. Nonetheless, it's always desirable to support some kind of external extensibility, even if limited to just some parts of the system. In this section, we are going to plunge into this fascinating world and focus on a dualistic problem:

  • Exposing the services of an application to a plugin
  • Integrating a plugin into the flow of the parent application

Plugins as packages

Often in Node.js, the plugins of an application are installed as packages into the node_modules directory ...

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.