Skip to content

Chapter 1 "Using TypeScript with Node.js" section is outdated; Node now supports native .ts execution without ts-node/tsx #13

Description

@aabdelrhmann1

Hi @lmammino and @mariocasciaro,

Thanks for the book, really enjoying it so far.

Just wanted to flag that the "Using TypeScript with Node.js" section (page 18-19) is a bit outdated now. It describes tsc, ts-node, and tsx as the main ways to run .ts files, but Node.js can now run TypeScript files directly with no setup at all:

node app.ts

This is called type stripping. It became stable in Node 24 (enabled by default since Node 23.6). Node just removes the type annotations and runs the plain JavaScript underneath, using a module called amaro.

One thing worth mentioning if you update this: type stripping doesn't actually check your types, it just removes them. So tsc is still needed for real type checking, this just replaces the need for ts-node/tsx when you simply want to run a file.

Thanks again for the book!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions