oxnode
v0.0.34
Published
Just a wrapper for @oxc-node/cli
Maintainers
Readme
oxnode
oxnode is a convenient wrapper for @oxc-node/cli, which provides a blazingly fast TypeScript/JSX execution environment for Node.js based on the Oxc toolchain written in Rust.
You can treat it as a faster alternative to
ts-nodeortsx.
Installation
Global Installation (Recommended)
npm install -g oxnodeUse with npx (No Installation)
npx oxnode your-script.tsYou can execute it with pnpm as well:
pnpm dlx oxnode your-script.tsUsage
Run a TypeScript file directly
oxnode ./src/index.tsExamples
// hello.ts
interface Greeting {
message: string
}
const greeting: Greeting = {
message: "Hello from oxnode!"
}
console.log(greeting.message)oxnode hello.ts
# Output: Hello from oxnode!// script.ts
import { readFile } from 'fs/promises'
import { join } from 'path'
const content = await readFile(join(process.cwd(), 'package.json'), 'utf-8')
const pkg = JSON.parse(content)
console.log(`Package name: ${pkg.name}`)oxnode script.ts