Node.js Adds Experimental TypeScript Support
Written by Kay Ewbank   
Tuesday, 30 July 2024

Node.js has added an experimental way to execute TypeScript files. The option uses the experimental flag --experimental-strip-types, and means Node.js will transpile TypeScript source code into JavaScript source code.

Node.js is an open-source, cross-platform asynchronous event driven JavaScript runtime built on Chrome's JavaScript engine. It uses an event-driven, non-blocking I/O mode and executes JavaScript code outside web browsers.

nodejslogo

Explaining the thinking behind the latest addition, TypeScript contributor Marco Ippolito said:

"I believe enabling users to execute TypeScript files is crucial to move the ecosystem forward, it has been requested on all the surveys, and it simply cannot be ignored. We must acknowledge users want to run node foo.ts without installing external dependencies or loaders."

He said he believes enabling users to execute TypeScript files is crucial to move the ecosystem forward, it has been requested on all the surveys, and it simply cannot be ignored.

There is a TC39 proposal for type annotations

Type stripping, as the name suggest, means removing all the types to transform the input in a JavaScript module. Ippolito points out that other runtimes also perform transformation of some TypeScript only features into JavaScript, for example enums, which do not exists in JavaScript.

During the transpilation process, no type checking is performed, and types are discarded.

Node.js 22 is downloadable now.

nodejslogo

More Information

Node.js Foundation Homepage

Node.js Experimental Type Stripper On GitHub

Related Articles

Node.js 22 Adds WebSocket Client

Node.js 21 Has Stable WebStreams

Node.js 20 Adds Permission Module

Node.js 19 Updates JavaScript Engine

Getting Started with Node.js

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Google Demands Dev Identity For All Android Apps
27/08/2025

As one door opens another closes. Just as we start to see some opening of the Android and Apple walled gardens Google is making a move to restrict who can create code for Android. 



Copilot Diagnostics Toolset for .NET In Visual Studio
02/09/2025

Microsoft has added a new diagnostics toolset for .NET development in Visual Studio. The Copilot Diagnostics for .NET is integrated with GitHub Copilot and aims to cut out the repetitive, tedious [ ... ]


More News

pico book

 

Comments




or email your comment to: comments@i-programmer.info