Introduction
In the previous chapter, we built an API using Node.js and Express. We talked about designing the API structure, HTTP methods, and JSON Web Token (JWT) authentication. In this chapter, we'll be looking at various aspects of JavaScript modules and module-based design.
Modules are important for programming productivity, breaking software into reusable modules. The modular design encourages developers to build software out of small, single-focus components. You may be familiar with popular UI libraries, such as Bootstrap, Material-UI, and jQuery UI. These are all sets of components – minimal graphical elements purposefully built so that they can be used in many situations.
Due to the extensive use of external libraries for both graphical elements and programming aspects, most developers are already familiar with the use of modules. That said, it is much easier to use a module than to create one or to write your application in a modular way.