Tagged articles
CommonJS
30 articles · Page 1 of 1
NestJS 12 releases core packages as ESM while preserving CommonJS compatibility via Node.js's require(esm), introduces Vitest and oxlint as defaults for new ESM projects, adopts Rspack for monorepos, adds Standard Schema support for validation and serialization, and includes an official observability SDK with distributed tracing.
CommonJSESMNestJS
0 likes · 11 min read

Node.js now marks require(esm) as stable in LTS releases, allowing CommonJS files to require synchronous ESM modules without extra flags, simplifying package.json configuration, eliminating the need for dual packages, and resolving the long‑standing CJS‑ESM split for the vast majority of projects.
CommonJSESMLTS
0 likes · 8 min read

This article explains why the ECharts library must be imported with the namespace syntax (import * as echarts) by examining ES Module and CommonJS differences, compatibility strategies, historical reasons, and practical guidelines for choosing the correct import style in frontend development.
CommonJSEChartsESM
0 likes · 7 min read

This article traces the history and reasons behind JavaScript’s module formats—from early AMD and UMD to Node’s CommonJS and the modern ECMAScript modules—explains migration challenges, tooling, testing nuances, and best practices for managing dual builds in contemporary projects.
CommonJSESMJavaScript
0 likes · 22 min read

An in‑depth look at JavaScript’s module journey—from early script tags and IIFE patterns, through CommonJS, AMD, CMD, UMD, to modern ES Modules—explaining each specification, its motivations, code examples, and how they shaped today’s front‑end development.
AMDCommonJSES Modules
0 likes · 14 min read

jQuery 4.0.0‑beta.2 introduces a major rewrite of its testing infrastructure, drops legacy IE support, adds full CommonJS and ESM compatibility with proper export handling, removes special Boolean attribute logic, fixes element position calculations in tables, and offers a slimmer build that omits ajax and deferred modules.
BetaBoolean AttributesCommonJS
0 likes · 9 min read

This article traces the evolution of JavaScript module systems—from the early script tags and manual dependency ordering, through CommonJS, AMD, and UMD, to the modern ECMAScript modules—explaining their origins, challenges, and how bundlers and package fields enable seamless usage across browsers and Node.js environments.
AMDCommonJSESM
0 likes · 13 min read


ByteFEAug 16, 2023 · Frontend Development
This article traces the history of frontend modularization from early global‑function scripts through IIFE, CommonJS, ES6 modules, AMD and CMD, explaining why modularization is needed, how each approach works, their drawbacks, and the key features of each specification.
AMDCommonJSES6
0 likes · 14 min read

This article explains how third‑party library authors can configure package.json fields such as main, type, exports, and module to provide dynamic entry points for both CommonJS and ESModule consumers, while also covering TypeScript's resolution strategy and practical code examples.
CommonJSESMExports
0 likes · 12 min read

The article explains how toggling TypeScript's esModuleInterop flag changes import behavior between CommonJS and ES Module syntax, causing runtime errors like “TPS is not a constructor,” and offers fixes—either revert the flag and use namespace imports or enable it and use default imports.
CommonJSESModuleNode.js
0 likes · 7 min read

Library authors can configure package.json using main, type, exports, and module fields to provide separate CommonJS and ES module entry points, enabling runtime selection based on import or require, improving tree‑shaking, bundler compatibility, and TypeScript type resolution while restricting undefined sub‑paths.
CommonJSESMExports
0 likes · 11 min read

This article explains why, despite years of ESM usage, Node 18 and TypeScript 4.7 still encounter import errors, explores the differences between CommonJS and ESM module resolution, and shows how to configure tsconfig and package.json to make Node correctly run ESM code.
CommonJSESMNode.js
0 likes · 10 min read

This article provides a comprehensive overview of front‑end modularization, covering the definition of modules, the evolution from early script tags through AMD/CMD to CommonJS and ES6, and explains why modern module syntax enables better dependency management and tree‑shaking.
AMDCommonJSES6
0 likes · 13 min read

This article explains the need for JavaScript modularization, compares major module standards such as CommonJS, AMD, CMD, UMD and ES Modules, and traces their historical evolution, highlighting benefits, drawbacks, and practical usage examples for modern front‑end development.
AMDCommonJSESM
0 likes · 11 min read

This article explains how Node.js implements module loading using the CommonJS wrapper, demonstrates the role of the built‑in vm module for isolated execution, and walks through building a custom Require function with path resolution, file reading, extension handling, caching, and automatic extension resolution.
CommonJSJavaScriptModule System
0 likes · 14 min read

This article examines why JavaScript applications encounter runtime errors when using CommonJS or ES6 modules, explains the underlying module loading mechanisms, highlights pitfalls of circular dependencies, and provides practical solutions—including webpack plugins and code adjustments—to reliably resolve such issues.
Circular DependencyCommonJSES6
0 likes · 20 min read

This article explains the latest Node.js package module specifications, covering how the "type", "exports", and "imports" fields in package.json determine ESM or CommonJS loading, the history of version changes, subpath mappings, conditional exports, and best practices for dual-module packages.
CommonJSESMExports
0 likes · 27 min read

Node.js implements the CommonJS module system by using global require and module objects that, when a module is requested, resolve its absolute path, load and wrap the file, evaluate it to populate module.exports, cache the result, and handle exports, circular dependencies, JSON and native addons.
CachingCommonJSExports
0 likes · 21 min read

The article traces JavaScript’s module evolution from inline scripts to CommonJS’s file‑scoped exports and require system, explains its minimal bundler implementation, compares AMD and CMD alternatives, and finally introduces native ES6 import/export syntax, highlighting key differences and the gradual deprecation of CommonJS.
AMDCommonJSES6
0 likes · 21 min read


政采云技术Dec 8, 2019 · Backend Development
This article delves into Node.js’s module system, explaining the CommonJS specification, how Node implements module loading, resolution, caching, and execution, and provides detailed analysis of core source code including Module constructor, require, _load, _resolveFilename, and file extension handling.
CommonJSModule SystemNode.js
0 likes · 17 min read

Node.js 13.2.0 removes the experimental flag, making ES module support stable and defining clear rules—file extensions, package.json type fields, and runtime flags—to decide whether a file is loaded as an ES module or a CommonJS module.
CommonJSES ModulesNode.js
0 likes · 3 min read

This article explains Node.js's CommonJS module system, covering how require loads modules, the role of module.exports versus exports, module classification, loading order, caching behavior, circular dependencies, and provides practical code examples for interview preparation.
CommonJSExportsNode.js
0 likes · 10 min read

This article explains how Node.js 12 introduced native ECMAScript Modules, compares them with CommonJS, shows how to enable the feature, configure package.json, and adapt code using import/export, import.meta, and other module‑specific changes.
CommonJSES ModulesModules
0 likes · 10 min read

This article explains how Node.js supports ES modules since version 8.5, compares CommonJS and ES module loading behaviors, demonstrates interoperability techniques with code examples, and outlines the practical implications of using the experimental‑modules flag for backend development.
CommonJSES ModulesModule Interoperability
0 likes · 8 min read

This comprehensive guide explores JavaScript module mechanisms—including CommonJS, Node.js core and file modules, AMD, CMD, UMD, and ES6 import/export—detailing their advantages, loading strategies, code examples, circular dependencies, and best practices for modern front‑end and back‑end development.
AMDCommonJSES6
0 likes · 25 min read

This article reviews the evolution of frontend moduleization over the past decade, discusses the problems of early script inclusion, presents various solutions such as namespaces, closures, CommonJS, ES6 modules, and modern build tools, and illustrates each approach with concrete JavaScript code examples.
CommonJSES6JavaScript
0 likes · 16 min read

This article compares Node's CommonJS require/module.exports with ES6's import/export syntax, explains their differences, usage patterns, and pitfalls, and offers guidance on when to adopt import over require as JavaScript engines evolve toward full ES6 support.
CommonJSES6Export
0 likes · 10 min read


Aotu LabApr 28, 2017 · Backend Development
James M. Snell explains the fundamental differences between CommonJS and ES6 modules in Node.js, why loading and execution timing matter, the challenges of supporting both systems, and the roadmap for native ES6 module support.
Asynchronous LoadingCommonJSES6 Modules
0 likes · 9 min read

This article explains the evolution of JavaScript module patterns—including CommonJS, AMD, CMD, and ES6—by illustrating their syntax, loading behavior, and practical drawbacks, and shows how to simulate modularity with simple global objects and closures.
AMDCommonJSES6
0 likes · 11 min read

An in‑depth look at the ongoing debate between CommonJS and ECMAScript Modules in Node.js, drawing on the latest TC39 discussions to explain their implementation differences, practical impacts, and why reconciling them has long puzzled the Node.js community.
CommonJSESMModules
0 likes · 2 min read
