CommonJSModule
CommonJSModule refers to a module that follows the CommonJS module specification, a standard that originated in the CommonJS project to enable modular JavaScript, particularly in server-side environments such as Node.js. A CommonJS module exports its API by assigning to module.exports or by attaching properties to exports. The module system is designed around synchronous loading and a clear, file-based scope.
When a CommonJS module runs, its code executes inside a wrapper function that provides five local variables:
Loading a module happens via require. The resolver can handle core built-in modules, relative file paths, and
CommonJSModules are widely used in Node.js and have influenced many bundlers and tooling for browser environments,