const fs = require('fs-extra'); async function myFunc() { const codexModule = await import('./codex/codex.bundle.mjs'); const modifiers = (codexModule as any).default.getModifiers(); const outputPath = './codex/codex.json'; fs.writeJson(outputPath, modifiers, { spaces: 2 }) .then(() => console.log('📗 Blockbite Codex written!')) .catch((err: any) => console.error('📕 Error Blockbite Codex', err)); } // Call the async function myFunc();