Node.js 22.8.0, the newest launch of the event-driven JavaScript runtime, provides a JavaScript API to allow on-disk caching of all modules loaded after the API known as, presenting a caching choice for code.
The API known as module.allow.CompileCache()
. It overrides the NODE_COMPILE_CACHE
setting variable, which solely finish customers may use to allow on-disk caching. The brand new API lets instrument and library authors handle the caching of their very own code. The answer is a built-in different to v8-compile-cache packages, providing higher efficiency and assist for ESM (ECMAScript Modules).
Launched on September 3, Node 22.8.0 will be downloaded from Nodejs.org. It’s categorised as a present launch quite than an LTS (long-term assist) launch. With this replace, Node now helps requiring code protection to satisfy a particular threshold earlier than a course of efficiently exits. Builders who wish to use this functionality should set the –experimental-test-coverage
flag. Thresholds will be set for forms of protection together with department, operate, and line coverages. Additionally in model 22.8.0, a taste of vm.createContext()
has been added to create a context with out contextifying its international object when vm.constants.DONT_CONTEXTIFY
is used. That is appropriate when customers wish to freeze the context or velocity up international entry if they don’t want the interceptor conduct.