Package Exports
- oxrun
- oxrun/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (oxrun) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
oxrun
⚓ Typescript node runtime powered by oxc-node
Feature
🚀 Super fast typescript transformer by oxc
🧭 Run ts with a single command
🙅 No installation required
👜 Import ts in js as a module
Usage
CLI
npx oxrun hello.ts
or install as dependency
pnpm add oxrun -D
{
"scripts": {
"dev": "oxrun scripts/dev.ts"
}
}
Programmatic
// hello.ts
const msg = 'hello'
console.log(msg)
export default msg
// entry.js
import oxrun from 'oxrun'
(async () => {
await oxrun('./hello.ts') // output: hello
const mod = await oxrun.import('./hello.ts')
console.log(mod.default) // output: hello
})()
Props
props.watch
- Type:
false | string
- Default:
false
props.ignore
- Type:
string
- Default:
undefined
Benchmark
cpu: Apple M2
runtime: node (arm64-darwin)
name hz min max mean p75 p99 p995 p999 rme samples
· oxrun 71.5572 1.1639 137.01 13.9748 16.0956 137.01 137.01 137.01 ±50.84% 40 fastest
· jiti (no-cache) 49.6227 0.6183 241.34 20.1521 9.4016 241.34 241.34 241.34 ±88.54% 30
· tsx (no-cache) 40.5017 2.3162 234.52 24.6903 16.3226 234.52 234.52 234.52 ±89.86% 23
· ts-node 19.4521 3.0683 238.53 51.4084 38.0820 238.53 238.53 238.53 ±104.82% 10 slowest
oxrun
1.44x faster than jiti (no-cache)
1.77x faster than tsx (no-cache)
3.68x faster than ts-node