UNPKG

tsx

Version:

TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files

2 lines (1 loc) 1.15 kB
var s=Object.defineProperty;var i=(r,t)=>s(r,"name",{value:t,configurable:!0});import{r as p}from"../../register-zZ7SWseA.mjs";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as n,i as c,c as u}from"../../register-HWZIKnmC.mjs";import"../../require-awuW45Q3.mjs";import{i as g,e as d}from"../../node-features-JeyyvQz6.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-CQhDiIsg.mjs";import"node:path";import"esbuild";import"node:crypto";import"node:os";import"../../temporary-directory-BDDVQOvU.mjs";import"../../client-D_mPDF5S.mjs";import"node:net";import"module";import"fs";import"os";import"path";import"node:util";import"../../index-gbaejti9.mjs";const f=i((r,t)=>{if(!t||typeof t=="object"&&!t.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const e=typeof t=="string",o=e?t:t.parentURL,m=Date.now().toString(),a=n({namespace:m});return!g(d)&&!c.test(r)&&u.test(r)?Promise.resolve(a.require(r,o)):p({namespace:m,...e?{}:t}).import(r,o)},"tsImport");export{p as register,f as tsImport};