package.lib.jiti.cjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jiti Show documentation
Show all versions of jiti Show documentation
Runtime typescript and ESM support for Node.js
The newest version!
const { createRequire } = require("node:module");
const _createJiti = require("../dist/jiti.cjs");
const transform = require("../dist/babel.cjs");
function onError(err) {
throw err; /* ↓ Check stack trace ↓ */
}
const nativeImport = (id) => import(id);
function createJiti(id, opts = {}) {
if (!opts.transform) {
opts = { ...opts, transform };
}
return _createJiti(id, opts, {
onError,
nativeImport,
createRequire,
});
}
module.exports = createJiti;
module.exports.createJiti = createJiti;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy