We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 005e560 commit b08aa7aCopy full SHA for b08aa7a
1 file changed
test/avoid-tla.ts
@@ -0,0 +1,10 @@
1
+// This is so annoying.
2
+// even if you ship as ESM, node programs will try to require() it,
3
+// which breaks when TLA is in use. So, effectively, rather than just
4
+// not supporting top level await, node DOES support it, but in a way
5
+// that throws a hand grenade at unsuspecting downstream users.
6
+// Great.
7
+import t from 'tap'
8
+import { createRequire } from 'node:module'
9
+const require = createRequire(import.meta.url)
10
+t.doesNotThrow(() => require('../dist/esm/node/index.js'))
0 commit comments