Skip to content

Commit 8d0de29

Browse files
committed
fix: import createRequire to handle npx tsx for ESM
1 parent 0db12ca commit 8d0de29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import crypto from 'crypto'
1212
import fs, { readFile } from 'fs/promises'
1313
import path from 'path'
1414
import os from 'os'
15+
import { createRequire } from 'node:module';
16+
const require = createRequire(import.meta.url);
1517

1618
// Global type declaration for typescript
1719
declare global {

0 commit comments

Comments
 (0)