Chapter 2. Modular Programming with JavaScript
Engineering in general is all about splitting large tasks into small ones and composing the solutions of these tasks in a system. In software engineering, we break the code-base into modules by following the principles of low coupling and high cohesion. In this chapter, we will talk about the approaches to create modules in JavaScript by covering the following topics:
- How to get out of a mess using modular JavaScript
- How to use asynchronous modules in the browser
- How to use synchronous modules on the server
- JavaScript built-in module system
- Transpiling CommonJS for in-browser use