odin-js-fundamentals-part-4/node_modules/@humanwhocodes/module-importer/dist/module-importer.js

19 lines
561 B
JavaScript
Raw Permalink Normal View History

2024-01-05 19:30:21 +00:00
import { createRequire } from 'module';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
/**
* @fileoverview Universal module importer
*/
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const require = createRequire(__dirname + "/");
const { ModuleImporter } = require("./module-importer.cjs");
export { ModuleImporter };