Node.js 20 officially released, introducing permission control

Node.js 20 has been officially released and will become an LTS release in October.

noteworthy changes

  • Introducing the Permission Model
  • Synchronous import.meta.resolve
  • Test Runner reaches steady state
  • Upgrade V8 JavaScript engine to 11.3
  • Support for building single executable applications
  • Ada upgrade to 2.0
  • Official support for ARM64 Windows
  • Requirements must specify the WASI version

  • Introducing the Permission Model

This feature is currently in an experimental stage. Node.js 20's permission control feature lets developers restrict access to specific resources during program execution, such as file system operations, child process spawning, and worker thread creation.

By using this feature, developers can prevent their applications from accessing or modifying sensitive data, or running potentially harmful code.

See the documentation for details: https://nodejs.org/api/permissions.html#process-based-permissions

  • Custom ESM loader hooks run on dedicated threads

ESM hooks provided via loader(  --experimental-loader=foo.mjs ) now run in a dedicated thread isolated from the main thread. This provides a separate scope for the loader and ensures that there is no cross-contamination between the loader and application code.

  • Test Runner reaches steady state

This update to Node.js 20 includes important changes to the test_runner module. After the update, the module has been marked as stable. Previously the test_runner module was in an experimental state, this change marks it as a stable module ready for production.

See the release announcement for details .

Guess you like

Origin www.oschina.net/news/237456/nodejs-20-0-0