env. file support for configuring environment variables.
The update, cited as the “current” version of Node.js and announced September 4, can be downloaded from the project website. With
env., Node.js proponents said the configuration file should follow the INI file format, with each line having a key-value pair for an environment variable. To initialise the Node.js application with predefined configurations, developers can use this CLI command:
node—file=config.env index.js. In addition, the change for environment variables enables definition of
NODE_OPTIONS directly in the
.env file, eliminating the need to put it in
Also in Version 20.6.0, in ECMAScript modules,
import.meta.resolve(specifier) can be used to obtain an absolute URL string to which
specifier. And a new
register API, available on
node.module, enables specification of a file that exports module customisation hooks. Data can be passed to these hooks.
Elsewhere in Node.js 20.60.0:
- When Node.js starts up, it now ensures there is a
v8::CppHeapattached to the V8 isolate. This lets users allocate in the
<a href="https://github.com/nodejs/node/blob/v20.6.0/test/addons/cppgc-object/binding.cc" rel="nofollow">node::SetCppgcReference(isolate, js_object, cppgc_object)</a>has been added to