UNPKG

@graphteon/juricode

Version:

We are forging the future with lines of digital steel

24 lines (21 loc) 719 B
#!/usr/bin/env node // ESM wrapper for juricode CLI import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const require = createRequire(import.meta.url); // Try to import the ESM version first, fallback to CJS try { await import(join(__dirname, '../dist/esm/index.js')); } catch (error) { try { require(join(__dirname, '../dist/cjs/index.js')); } catch (cjsError) { console.error('Failed to load both ESM and CJS versions:'); console.error('ESM Error:', error.message); console.error('CJS Error:', cjsError.message); process.exit(1); } }