What is CommonJS?
CommonJS is a module system historically used extensively in Node.js. It uses require() to import modules and module.exports or exports to expose values. CommonJS modules are typically loaded synchronously and have their own module scope.
Key Takeaways
- CommonJS is a Node.js module system.
- require() imports modules.
- module.exports exports values.
Knowledge Check
Which syntax is associated with CommonJS modules?