Live data from Hacker News

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

nodejs.org

91–100 of 275 posts

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

#91

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

IMHO the only reason you are using JS in the backend is because of some meta framework, otherwise is not worth. So at least for Nuxt is nitro, not sure for SvelteKit or the other React meta frameworks.

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

#92
post #61

Earlier quoted context omitted.

Bun has lots of issues and lots of incompatibilities with a lot of packages.

What are the issues

For one I do not want to run my startup at the mercy of VC funded tech. Node.js is open source and maintained by a foundation, it will not "run out of funds" or be abandoned if there is no profitability in the near future.

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

#93

But still, bun is the winner here. I recently started using bun and now not moving to node.js again. It just works.

Node still has a better repl, but I do agree. Bun is really good. It’s my goto, too.

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

#94
post #79

Earlier quoted context omitted.

As a quick aside, “them” is an object pronoun, not a subject pronoun. The correct word you needed is “they”. You couldn’t phrase your original question as a statement “Them have though.” That’s often a quick test for valid English grammar. With the correct pronoun, it makes more sense: “They have though.” As another example, take this sentence: “Have you seen them though?” “You” is the subject of that sentence, and “…

Them is fine. It's short for "Have them [Node bozos improved it], though?" Or, equally likely it, refers to deno and bun ("deno and bun has really made Node focus and improve", "Have them (deno and bun) really made Node focus and improve, though?")

Your expanded version is also incorrect.

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

#95

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.

Does this run tsx? Even with the types stripped you still need the JSX transformed to JavaScript

It doesn’t. The comment you’re replying to is referring to tsx, the package that lets you execute ts files, not to running files with the tsx extension.

https://github.com/privatenumber/tsx

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

#96
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.

Sure, who is going to budget project upgrade effort of ensuring all dependencies work equally as well?

There is a reason why so many Java, Python, .NET/C#, C, C++,.. projects are stuck several versions behind.

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

#97
post #62

Earlier quoted context omitted.

jslint/tslint are an install away.

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

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

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

#99
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?

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

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

#100
I’m not a heavy JS/TS dev so here’s an honest question: why not use Bun and forget about node? Sure I understand that not every project is evergreen but isn’t Bun a much runtime in general? It supports TS execution from day 1, has much faster dependency resolution, better ergonomics… and I could keep going.

I know I’m just a single data point but I’ve had a lot of success migrating old node projects to bun (in fact I haven’t used node itself since Bun was made public)

Again, I might be saying something terribly stupid because JS/TS isn’t really my turf so please let me know if I’m missing something.

Post reply on HN