Node.js upgrade adds environment variable config

Uncategorized

Node.js 20.6.0, the current variation of the asynchronous, event-driven JavaScript runtime, consists of integrated env. file assistance for configuring environment variables.The update, mentioned as

the “present “variation of Node.js and announced September 4, can be downloaded from the project website. With env., Node.js advocates said the configuration file ought to follow the INI file format, with each line having a key-value pair for an environment variable. To initialize the Node.js application with predefined setups, designers can utilize this CLI command: node– file= config.env index.js. In addition, the modification for environment variables allows meaning of NODE_OPTIONS straight in the.env file, getting rid of the need to put it in package.json.Also in Version 20.6.0, in ECMAScript modules, import.meta.resolve( specifier)can be utilized to obtain an outright URL string to which specifier. And a new register API, offered on node.module, allows spec of a file that exports module customization hooks. Information can be passed to these hooks.Elsewhere in Node.js 20.60.0: When Node.js starts up, it now makes sure there is a v8:: CppHeap attached to the V8 isolate. This lets users allocate in the v8:: CppHeap utilizing headers from the V8 JavaScript

  • engine, which are now included in the Node.js headers offered to add-ons. To help with development of JavaScript-to-C++referrals , of which the V8 garbage collector can be aware, an assistant function, node:: SetCppgcReference(isolate, js_object, cppgc_object)has actually been added to node.h. This API can be used to avoid hard-coding the design of JavaScript wrapper things. V8 may provide a native option in the future, which might replace this Node.js-specific assistant. Copyright © 2023 IDG Communications, Inc. Source

Leave a Reply

Your email address will not be published. Required fields are marked *