news.volyx.in

Node.js adds experimental support for TypeScript (github.com)

1204 points by magnio · 746 days ago · 554 comments on HN

Article summary

Node.js has added experimental support for TypeScript, allowing users to execute TypeScript files directly without the need for external dependencies or loaders. This feature is still in its early stages and has some limitations, such as not supporting extension-less imports. The implementation uses the @swc/wasm-typescript package to strip type annotations from TypeScript code. This move brings Node.js closer to parity with Deno and Bun, which already support TypeScript.

Main themes

  • Node.js and TypeScript integration
  • Experimental features
  • TypeScript support
  • Deno and Bun comparison
  • JavaScript ecosystem

What commenters say

  • The addition of TypeScript support to Node.js is a welcome move, bringing it closer to parity with Deno and Bun.
  • Some users prefer to use a centralized registry for package management, while others prefer the flexibility of URL imports.
  • The performance of different TypeScript execution libraries, such as tsx and swc-node, is a topic of debate among users.
  • The naming of packages and libraries in the JavaScript ecosystem can be confusing and lead to conflicts.
  • Some users have had negative experiences with certain libraries, such as tsx, due to issues like slow startup performance or unpleasant maintainers.
  • Competition between Node.js, Deno, and Bun drives innovation and improvement in the JavaScript ecosystem.
  • The trade-offs between using a established but potentially slower library like ts-node versus a newer, faster library like swc-node are being weighed by users.