Live data from Hacker News

Node.js is able to execute TypeScript files without additional configuration

nodejs.org

81–90 of 275 posts

Re: Node.js is able to execute TypeScript files without additional configuration

#84

I think this + node:test makes Node.js a pretty compelling sensible default for most things now. Running things with `tsx` was such a QoL improvement when it happened, but it didn't solve everything. Runtime type assertion at the edges is mostly solved through `zod` and tools like `ts-rest` and `trpc` makes it so much easier to do full-stack Typescript these days.

I'm very much in favor of TS support directly in node. vitest has made it easier these days, but I've lost too much time over the years getting the balance just right when configuring test environments for .ts files.

trpc and ts-rest are a different animal in my opinion. I'm happy to use either one but won't deal with them in production. For trpc that's mainly due to the lack of owning API URLs and being able to more clearly manage deprecating old URLs gracefully.

For ts-rest I just tend to prefer owning that setup myself, usually with zod and shared typings for API request/response pairs. It also does irk me every time I import what is clearly an RPC tool named "-rest"

Re: Node.js is able to execute TypeScript files without additional configuration

#86
post #34

Earlier quoted context omitted.

> TypeScript is more like a linter that's exactly the point--GP is pointing out that node can't do that part

Which is why the title is "Node can now execute Typescript files" and not lint, check, or even run TypeScript files.

I'm not sure what the distinction between "execute" and "run" is; is there a difference?

Re: Node.js is able to execute TypeScript files without additional configuration

#89
post #68
post #63

Earlier quoted context omitted.

Have them though? On the projects I am involved, they could even not exist, only node LTS releases matter, and the most recent projects are still node 20.

22 is LTS. The future is now.

All even versions are LTS btw, maybe what you mean is that version 22 entered in maintenance mode (hence stable) and new features will not be added.

Re: Node.js is able to execute TypeScript files without additional configuration

#90

What backend framework is the go to these days? Still Express?

Express is still popular, but a lot projects these days use a full-stack framework like Next.js, SvelteKit, etc.

Fastify, NestJS (bleh), Koa, Hono are the modern replacements for express, none of them have caught on as a standard though. My personal favorite for small projects is Polka (https://github.com/lukeed/polka), when I'm not using Go instead.

Post reply on HN