Transcript for:
Node.js's Built-in TypeScript Support

nodes.js just did something huge and almost nobody noticed for the past decade TypeScript has been replacing JavaScript in everything from front-end apps to backend APIs everyone writes TypeScript now whether they admit it or not and naturally modern JavaScript runtimes had to keep up dino was built around TypeScript from day one and Bun added native TS support with no configuration required but Node has been dragging its feet on the matter for years using TypeScript in Node meant cobbling together your own tool chain and config processes which became really annoying in the context of the seamless experience offered by other runtimes however this is now finally changing thank you the Amaro version one release which is Node's official built-in type stripping loader for TypeScript files is one of the most important steps Node has taken towards making TypeScript a first class citizen in its ecosystem note that Amaro is not some magical transpiler or bundler and its entire job is to strip TypeScript types at runtime so your TS files can run directly in Node without going through an external build process under the hood it delegates the actual transformation work to SWC which is a higherformance Rustbased compiler that's basically become the industry standard at this point amaro supports two distinct modes the default strip types simply removes the type annotations and runs the remaining code as plain JavaScript the transform types mode on the other hand is a bit more advanced and is aimed to handle features like enoms which used to be a huge blocker for people trying to run TypeScript in Node directly what's even more exciting is that Amaro actually works with TS files from the Node modules folder this was something Node's previous experimental support couldn't handle properly so now you're not just limited to your own code you can run entire dependency trees written in TypeScript without needing to pre-ompile everything or rewrite half the stack in practice this means that you can start working with TypeScript in NodeJS today without any additional steps your IDE will pick up any TS warnings and errors to guide you properly but at runtime Node will just treat your TS files like regular JavaScript so we are getting the TypeScript developer experience without the build steps that usually come with it in all fairness the DX is not quite the Dino Arbon experience yet but it's finally close enough that most developers won't care and more importantly it's officially supported by the Node Core team the release also paves the way for TypeScript support in Node to be promoted from experimental to stable later this year but of course there's still friction not everyone is running the latest version of Node and some environments still lag behind on support there are already calls to backport tomorrow to Node 22 to help close the gap and it sounds like the Node team is at least aware of that need so if you've been holding off on TypeScript in Node because you didn't want to babysit a tool chain now's the time to take another look if you like this video you should check out one of these ones next