By Barayuda Gautama2 min read
The Difference Between .mjs, .cjs, and .js Files in Node.js
Node.js supports two module systems (ESM and CommonJS). The file extensions .mjs/.cjs and the package.json "type" field decide which one you’re using—and that affects imports, tooling, and publishing.