Tag

Require

1 views collected around this technical thread.

DaTaobao Tech
DaTaobao Tech
Sep 26, 2022 · Backend Development

Deep Dive into Node.js CJS Module Loading Process

The article dissects Node.js v17’s source to reveal how the CommonJS `require` system is bootstrapped, how native modules are loaded, how `Module._load` resolves, caches, and executes user files, and how the overall CJS loading pipeline operates step‑by‑step.

BackendCJSNode.js
0 likes · 15 min read
Deep Dive into Node.js CJS Module Loading Process
Sohu Tech Products
Sohu Tech Products
Aug 25, 2021 · Backend Development

Understanding Node.js Module System and Implementing a Custom Require Loader

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.

CommonJSNode.jsRequire
0 likes · 14 min read
Understanding Node.js Module System and Implementing a Custom Require Loader
vivo Internet Technology
vivo Internet Technology
Mar 3, 2021 · Backend Development

Understanding the Node.js Module System: Resolving, Loading, Wrapping, Caching and Exports

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.

CommonJSNode.jsRequire
0 likes · 21 min read
Understanding the Node.js Module System: Resolving, Loading, Wrapping, Caching and Exports
政采云技术
政采云技术
Dec 8, 2019 · Backend Development

Exploring the Source Code of the Node.js Module System

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.

BackendCommonJSNode.js
0 likes · 17 min read
Exploring the Source Code of the Node.js Module System