Live data from Hacker News

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

nodejs.org

161–170 of 275 posts

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

#161
post #97

Earlier quoted context omitted.

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

I forgot that even though fmt will never suffer from middle man attacks downloading the Go toolchain, the standard library already covers 100% of the uses cases someone cares about using Go for, and no one is using CGO.

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

#162
post #92
post #61

Earlier quoted context omitted.

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.

Yeah, but it's not a big bet. Deno can do it, Bun can do it, if they die a tragic VC-fueled death then somebody else (maybe Node) can do it. Using Bun to me is just like using a microwave oven in 1980 — there weren't a lot of microwavable convenience foods yet, but you could sure heat up some leftovers more conveniently and quickly.

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

#163

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 mean TypeScript. TypeScript is finally usable by default.

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

#164

Earlier quoted context omitted.

"Written only in TypeScript" might put it better. If your module ships TypeScript source and a JS build as it should, then this will never affect it. Otherwise, to support stripping arbitrary modules would immediately compromise the design goal of light weight, due to the torrent of ill-founded and -formed bug reports incorrectly raised on Node that would follow. ("Don't make the maintainers' lives too miserable to c…

Why would I want to ship a JS build for my private package? That's just extra machinery I don't need. Switching to a superior runtime would be easier.

Well, I don't suppose I know, but if it's an argument you want then that's actually room 12a just next door.

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

#165

https://github.com/nodejs/node/issues/57215 Not supporting type stripping in node_modules is unfortunate

But... that's like half the reason why I wanted this feature... Writing a library in TypeScript (with typechecks in CI/CD as devDependencies) and just importing it directly from Node.js...

Build it.

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

#167

This is great up until you get to the fact that typescript will not be accepted under node_modules [0]. That leads me to ask, what about project dependencies? I wrote a lib for my data models in typescript and I want to import that into my app in node, in typescript? Does the rule only apply to npm packages? There’s opportunity here… I wrote a runtime in golang that runs typescript (well, JavaScript in general). The…

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

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

#169

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.

nah. it is still eons behind literally everything else

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

#170

https://github.com/nodejs/node/issues/57215 Not supporting type stripping in node_modules is unfortunate

No, is the right call. TypeScript has breaking changes. It would need to be standardized first.

What? All this does is strip types
Post reply on HN