O'Reilly logo

Node.js Design Patterns - Second Edition by Luciano Mammino, Mario Casciaro

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

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 ...

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