TLDR Web Dev · ARTICLES & TUTORIALS

IMPROVING NODE.JS LOADER PERFORMANCE

sentry.engineering6 min read

Summary from the TLDR Web Dev newsletter

Node.js supports two types of modules: EcmaScript (ES) modules and CommonJS modules. ES modules are the official standard and are supported by modern browsers, while CommonJS modules are used by Node.js by default, but are not supported by browsers. Node.js determines which module loader to use based on the file extension: .mjs for ES modules, .cjs for CommonJS modules, and .js with package.json settings. This article discusses optimizations made to improve the performance of package.json reading and parsing in Node.js, ultimately resulting in faster applications.