Y
Hacker News
new
|
ask
|
show
|
jobs
by
moltar
850 days ago
Node has native top level await. However, figuring out how to make it work is an exercise in frustration for many.
3 comments
chromakode
850 days ago
Yep! It requires ESM, which had other knock on effects in my codebase, IIRC with Lexical. I needed to hack around this a bit for Deno's module system as well (using esm.sh to preprocess Lexical) but it was a much nicer DX.
link
tehbeard
850 days ago
Is it much the same as trying to use esm in node while having legacy CJS code? Several options that end up with weird tradeoffs and bugs?
link
throwaway11460
850 days ago
npm install -g tsx
Name your files .ts and run with tsx ./file.ts
All done, good to go
link
FractalHQ
850 days ago
I just use npx vite-node or bun to run TS directly
link