Paul Krill
Editor at Large

Node.js previews network inspection support

news
Oct 04, 20241 min
Development Libraries and FrameworksJavaScriptNode.js

Update to the LTS release of the JavaScript runtime introduces initial support for network inspection as an experimental feature.

Flashlight, illumination, investigation, discovery
Credit: Realstock/Shutterstock

Node.js v20.18.0, a just-introduced update to the Long-Term Support (LTS) version of the popular asynchronous, event-driven JavaScript runtime, features experimental network inspection support.

Introduced October 3, Node.js 20.18.0 enables users to inspect network activities occurring within a JavaScript application. Still in active development, this capability is initially limited to HTTP and HTTPS modules only. To use this feature, Node.js must be started with the command $ node --inspect-wait --experimental-network-inspection index.js.

Other highlights of Node.js 20.18.0 include a new option for the tls.createSecureContext API. Developers can use tls.create.SecureContext({allowPartialTrustChain:true}) to treat non-self-signed certificates in the trust CA certificate list as trusted.

Node.js 20.18.0 also implements a new flavor of vm.createContext() that creates a context with a freezable globalThis, meaning it creates a context without contextifying its global object when vm.constants.DONT_CONTEXTIFY is used. This is suitable when developers want to freeze the context or speed up the global access if they do not need the interceptor behavior imposed when the global is contextified, according to release notes.