June 2025
Intermediate to advanced
837 pages
24h 50m
English
You already got to know the module systems of Node.js in the approach when we looked at the core modules of Node.js. In the following sections, we’ll take a closer look at the module systems, and you’ll learn how to split your application into multiple files in both the CommonJS and ECMAScript module systems, as well as how the module systems work together.
In Node.js, a module is a self-encapsulated scope for variables. This means that you can define variables at the top level in a file, and they are valid only in the module. This avoids the accidental definition of global variables. However, this also means that without the module system, you have no way to use functionality from your module ...
Read now
Unlock full access