Getting started
Introduction
Learn what oruntime does, which runtimes it targets, and the principles behind its API.
Introduction
oruntime is an ESM TypeScript library that provides compatibility primitives across JavaScript environments. It answers three questions:
- Which runtime is executing my code?
- Which capabilities are actually available?
- How can common features be used with consistent behavior?
Supported runtimes
| Runtime | Description |
|---|---|
node | Node.js |
bun | Bun |
deno | Deno |
workerd | Cloudflare Workers and workerd environments |
browser | A browser window with window and document |
unknown | An unrecognized environment |
What oruntime provides
Philosophy
oruntime favors Web standards and APIs that already work across runtimes. It does not wrap an existing shared standard or replace specialized solutions.
Capability detection confirms that an API exists. It does not guarantee that permissions, platform policies, or configuration will allow a particular operation.
Minimal example
import { createRuntimeAdapter, fetchJSON } from 'oruntime'
const runtime = createRuntimeAdapter()
console.log(`Runtime: ${runtime.name} ${runtime.version ?? ''}`)
if (runtime.capabilities.fetch) {
const status = await fetchJSON<{ ok: boolean }>('https://example.com/status')
console.log(status.ok)
}
Next steps
- Install the package.
- Follow the quick start.
- Review runtime support.