Paul Krill
Editor at Large

Node.js unveils experimental TypeScript support

news
Aug 8, 20242 mins

Node.js v22.6.0 introduces experimental feature that strips type annotations from TypeScript files, allowing them to run without changing TypeScript syntax.

Hands type on a laptop keyboard with lines of code visible on the display.
Credit: SeventyFour / Shutterstock

Node.js v22.6.0, the newest version of the popular JavaScript runtime, has just been released with experimental TypeScript support.

Node.js 22.60 introduces the --experimental-strips-type flag for initial support for TypeScript, Microsoft’s popular JavaScript variant that has syntax for types. The Node.js update was released August 6. Node.js downloads can be accessed from nodejs.org.

The TypeScript capability strips type annotations from .ts files, enabling them to run without transforming TypeScript-specific syntax. The support is currently limited to inline type annotations, and does not include features such as enums or namespaces. Additionally, explicit file extensions are required in import and require statements. The feature also enforces the use of the type keyword for type imports to avoid runtime errors, and is disabled for TypeScript in node-modules by default. The addition of TypeScript support, though, puts Node.js more in line with the rival Deno runtime, which supports JavaScript, TypeScript, and WebAssembly.

Also featured in the Node.js v22.60 update is initial support for network inspection. This also is an experimental feature, which developers must enable using the --experimental-network-inspection flag. With this feature enabled, developers can inspect network activities occurring within a JavaScript application. To use network inspection, developers can start a Node.js application with the following command:

$ node --inspect-wait --experimental-network-inspection index.js

Network inspection capabilities are in active development but currently limited to the http and https modules, the project said. Additionally, the Network tab in Chrome DevTools will not be available until the feature request on the Chrome DevTools side is addressed.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author