Key differences:
- ESM:
import/export, static analysis, async loading - CJS:
require/module.exports, dynamic, sync loading
ESM supports tree-shaking (removing unused code). CJS runs require at runtime. Modern JavaScript prefers ESM, but CJS remains common in Node.js.