@digitak/esrun
Version:
Execute directly your Typescript files using Esbuild
14 lines (13 loc) • 483 B
JavaScript
import Runner from "./runners/Runner.js";
import Watcher from "./runners/Watcher.js";
export { Runner, Watcher, esrun };
/**
* Run any .ts or .js file
*/
export default async function esrun(inputFile, options) {
if (options?.watch && options?.inspect) {
console.warn(`--inspect and --watch options are not compatible together. Disabling watch mode.`);
options.watch = false;
}
return new (options?.watch ? Watcher : Runner)(inputFile, options).run();
}