Live data from Hacker News

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

nodejs.org

221–230 of 275 posts

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

#221
post #97

Earlier quoted context omitted.

werent one of the js linters part of a supply chain attack recently?

Maybe, are you sure Go dependencies are immune to similar attacks?

go std lib being compromised would be a pretty major achievement

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

#222
post #4

Impressed with what Node is doing the last years, deno and bun has really made Node focus and improve. It was stuck for a while

They added type striping, not full TS support.

And the biggest issue with Node IMO is that the standard lib still forces you to rely on endless npm dependencies.

Node is still very much stuck.

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

#223
post #213

Earlier quoted context omitted.

> why not use Bun I dislike being on the bleeding edge for things. NodeJS is the most supported in the JS ecosystem. I find it much better to just be on the "default" option for things. You know, choose boring technology.

> You know, choose boring technology. Is it a boring technology? I remember trying Node.js when it just came out, and I don't think all that much improved. Whole node.js always felt one step forward, two steps back. A lot of early design decisions still hurt it. I would call it stagnated before I call it boring.

If you are choosing from "all backend technologies", Node may or may not count as boring. It's certainly not as boring as Java.

If, for whatever reason, you need to run JS outside the browser, then Node seems the most boring of all the possible options. Certainly "rewriting all our JS code in Java" sounds a lot less boring.

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

#224

Earlier quoted context omitted.

Yes, with the difference that Google would have to be compromised in order to poison the go distributable containing fmt tool. With js, it’s enough to poison any single one of the 1400 dependencies of the linter

Use biome, it doesn't have any external dependencies. eslint should have been put to rest a long time ago.

someone else recommended this too, I'll give it a shot next time I'm in js land.

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

#225

Earlier quoted context omitted.

Compile the packages to JavaScript before publishing. We absolutely should but be publishing TypeScript to npm.

I can understand the argument, since npm has no solution for TypeScript packages, unlike JSR: "You publish TypeScript source, and JSR handles generating API docs, .d.ts files, and transpiling your code for cross-runtime compatibility." Still would have been nice to have this for private packages. This makes Deno/Bun much more attractive alternatives

JSR does that? Now that might be a good reason to move my packages over to get rid of tsup.

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

#226

Even though this should be the way to go, it still leaves a bitter taste. Remember ESM fiasco? Now we have a few years of that all over again, this time with different versions of TypeScript, settings, and tsgo. Good news!

This is for transpilation only. it does not actually validate the typescript or perform any checks during runtime.

esm actually caused errors so there should not be any issues here

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

#227
post #101

Earlier quoted context omitted.

Node is just inline transpiling the TS into JS, then running the JS.

This is misleading. It is not transpiling TS in JS, it is transpiling a subset of TS into JS. If my normal TS code can not be "executed" by Node, then it is not executing TS per definition but something else. If you are good with Node supporting and "executing" only a subset of TS and lacking useful features, that's fine. But don't tell people it is executing TypeScript. That's like me saying my rudimentary C++ compi…

It's quite close to 100%. It makes one extra-strictness toggle mandatory. Saying it's not TS is much more misleading.

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

#229

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.

This. It's 2025 and the node ecosystem is finally usable by default! ESM modules just work with both Node and Typescript, Node can run .ts files, and there's the a good enough test runner built in. --watch. The better built in packages - `node:fs/promises` - are nice with top-level await for easier async loops. It took a while to convince everyone involved to just be pragmatic, but it's nice now.

You did the "this" thing AND the "it's $CUR_YEAR"

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

#230
post #188

Earlier quoted context omitted.

Just wait, you'll find the python pain points at some point. Two types of languages...

What are the main pain points?

Package and environment management are both pretty commonly brought up.
Post reply on HN