The Node.js team recently released Amaro v1.0.0, a significant milestone towards stable TypeScript support. Amaro is Node’s official type-stripping loader and is a key stepping stone towards official .ts loading.
For a long time, Node.js lacked support for TypeScript, forcing developers to rely on third-party toolchains or to favor alternative JavaScript runtimes like Deno, which natively supports TypeScript. Then, starting version 23.6 (shipped in January this year), developers could run TypeScript natively in Node.js. Amaro’s move to stable status brings Node a step further towards stable TypeScript support.
Amaro is a wrapper around @swc/wasm-typescript
, a WebAssembly port of the SWC TypeScript parser. SWC is used internally by Node.js for type stripping. One of Amaro’s key features is its ability to process TypeScript files within node_modules
when used as a global loader, a notable advantage over Node.js’s current experimental support. It also supports two modes: strip-types
, which is the default and only removes type annotations, and transform-types
, for more complex transformations like enums.
Developer discussions among developers on platforms like Reddit show a generally positive, albeit cautious, sentiment. , ismail5412 commented on potential limitations:
In some projects we removed enums and were able to use it at production. Working pretty fine. [Reddit]
In a Reddit thread discussing the use of native type stripping in production, some developers expressed concerns about production readiness:
I’m sorry but do the “stable” version of that feature exist in any Node LTS??? If not how can we use it in “production” ???
kei_ichi
Despite these reservations, some developers are already successfully leveraging the feature:
It has been unflagged in 23.x, so naturally it is in 24. I’m using it in production with 22 and zero issues (provided that you have a properly configured typecheck with eraseableSyntaxOnly and the like).
Nocticron
Others noted how the native support is replacing the need for external tooling:
I am using it in a real production app, albeit only in the local development environment, as well as in production CI pipelines, with no issues… if you are able to use Node’s native type stripping, then there’s definitely no need to use those packages [tsx/ts-node].
abrahamguo
SWC is an extensible Rust-based platform targeting the next generation of fast developer tools. Tools like Next.js, Parcel, and Deno, as well as companies like Vercel, ByteDance, Tencent, Shopify, Trip.com use SWC.
Amaro is distributed under the MIT license. Contributions are welcome and should follow the GitHub project’s contribution guidelines and code of conduct. Amaro 1.0 supports TypeScript 5.8.