--- - branch: MAIN date: Wed Sep 6 19:28:21 UTC 2023 files: - new: '1.271' old: '1.270' path: pkgsrc/lang/nodejs/Makefile pathrev: pkgsrc/lang/nodejs/Makefile@1.271 type: modified - new: '1.76' old: '1.75' path: pkgsrc/lang/nodejs/PLIST pathrev: pkgsrc/lang/nodejs/PLIST@1.76 type: modified - new: '1.243' old: '1.242' path: pkgsrc/lang/nodejs/distinfo pathrev: pkgsrc/lang/nodejs/distinfo@1.243 type: modified id: 20230906T192821Z.30b2486e9c8c7d837999cb83d13b24396682d096 log: | 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 module: pkgsrc subject: 'CVS commit: pkgsrc/lang/nodejs' unixtime: '1694028501' user: adam