sales@avioxtechnologies.comSubscribe

Innovation TrackerNews

Node.js 22.1.0 (Current)

Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.

Published By From Node.js News · 1 min read

This patch implements automatic on-disk code caching that can be enabled via an environment variable NODE_COMPILE_CACHE=/path/to/cache/dir .

When set, whenever Node.js compiles a CommonJS or a ECMAScript Module, it will use on-disk V8 code cache persisted in the specified directory to speed up the compilation. This may slow down the first load of a module graph, but subsequent loads of the same module graph may get a significant speedup if the contents of the modules do not change. Locally, this speeds up loading of test/fixtures/snapshot/typescript.js from ~130ms to ~80ms.

To clean up the generated code cache, simply remove the directory. It will be recreated the next time the same directory is used for NODE_COMPILE_CACHE .

This is an excerpt. The full article is published by Node.js News.

Continue reading at Node.js News

Insights & Understanding

Frequently Asked Questions

Answers to common questions regarding this article's topic, architecture, and practical applications.