Subject: CVS commit: pkgsrc/lang/nodejs
From: Adam Ciarcinski
Date: 2023-09-06 21:28:21
Message id: 20230906192821.33CBDFBDB@cvs.NetBSD.org

Log Message:
nodejs: updated to 20.6.0

Version 20.6.0 (Current)

Notable changes

built-in .env file support

Starting from Node.js v20.6.0, Node.js supports .env files for configuring \ 
environment variables.

Your configuration file should follow the INI file format, with each line \ 
containing a key-value pair for an environment variable. To initialize your \ 
Node.js application with predefined configurations, use the following CLI \ 
command: node --env-file=config.env index.js.

For example, you can access the following environment variable using \ 
process.env.PASSWORD when your application is initialized:

PASSWORD=nodejs
In addition to environment variables, this change allows you to define your \ 
NODE_OPTIONS directly in the .env file, eliminating the need to include it in \ 
your package.json.

import.meta.resolve unflagged

In ES modules, import.meta.resolve(specifier) can be used to get an absolute URL \ 
string to which specifier resolves, similar to require.resolve in CommonJS. This \ 
aligns Node.js with browsers and other server-side runtimes.

New node:module API register for module customization hooks; new initialize hook

There is a new API register available on node:module to specify a file that \ 
exports module customization hooks, and pass data to the hooks, and establish \ 
communication channels with them. The “define the file with the hooks” part \ 
was previously handled by a flag --experimental-loader, but when the hooks moved \ 
into a dedicated thread in 20.0.0 there was a need to provide a way to \ 
communicate between the main (application) thread and the hooks thread. This can \ 
now be done by calling register from the main thread and passing data, including \ 
MessageChannel instances.

We encourage users to migrate to an approach that uses --import with register, \ 
such as:

node --import ./file-that-calls-register.js ./app.js
Using --import ensures that the customization hooks are registered before any \ 
application code runs, even the entry point.

Module customization load hook can now support CommonJS

Files:
RevisionActionfile
1.271modifypkgsrc/lang/nodejs/Makefile
1.76modifypkgsrc/lang/nodejs/PLIST
1.243modifypkgsrc/lang/nodejs/distinfo