Skip to main content

What is CommonJS?

Entry NodeJS
Quick Answer CommonJS (CJS) is the original module system in Node.js Ò€” it uses require() to import and module.exports to export. It loads modules synchronously, which is fine for server-side code. It's still the default in most Node.js projects, though ES Modules (import/export) are now also supported.

Answer

CommonJS is Node’s module system using module.exports and require for import and export.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice