top | item 41064623

(no title)

yamumsahoe | 1 year ago

btw if anyone is looking to run ts on node, there is tsx. there is also ts-node but i prefer tsx.

https://github.com/privatenumber/tsx

discuss

order

iansinnott|1 year ago

Seconded again. While tsx usually just works ts-node almost never just works. tsx is perhaps unfortunately named though so it may confuse people at first since it has nothing to do with jsx syntax.

jimvdv|1 year ago

Thank you for bringing this up, I almost ignored this project since I assumed it had something to do with TypeScript + JSX.

The JS ecosystem sure struggles with naming things.

tills13|1 year ago

It's named as such to mirror `npx`

jessym|1 year ago

I second this. The tsx library is zero config and always "just works" in my experience, which puts it miles ahead of ts-node, imo.

wruza|1 year ago

Tsx’s only reset-in-console mode is <Enter>, which makes it impossible to develop cli apps in watch mode.

You cannot run tsx from a non-project cwd if you’re using tsconfig/paths.

And personally I find its maintainers relatively unpleasant to message with. Leaves “you’re plebs” aftertaste most of the times.

silverwind|1 year ago

tsx has very slow startup performance, I prefer https://github.com/swc-project/swc-node which is around twice as fast.

dimgl|1 year ago

We have not seen this whatsoever. How big is your project? `tsx` is almost instantaneous in a server-side project of ours.

herpdyderp|1 year ago

Does swc-node work with code coverage calculation libraries? For a long time tsx didn’t (and it’s still pretty finicky) so that kept me from using it.