oruntime
Write code around the capabilities it needs, not around the runtime that executes it.
oruntime detects the current JavaScript environment and provides a typed, consistent API for inspecting its capabilities, reading environment variables, accessing arguments, finding the current working directory, and using portable primitives for Fetch, timers, and URLs.
Framework-agnostic and built on Web standards, the library lets you share the same code across Node.js, Bun, Deno, Cloudflare Workers, and browsers without hiding the important differences between those environments.
Runtime features
What the library supports
- ordered runtime detection and runtime versions when available;
- a typed description of the capabilities that are actually present;
- a common interface for environment variables, arguments, and the current directory;
- Fetch utilities with response validation and JSON or text readers;
- abortable timers and explicit timeouts;
- URL creation, resolution, and modification;
- common errors with stable codes and preserved causes;
- extension points for injecting globals in tests.
oruntime does not reimplement file systems, paths, HTTP or WebSocket servers,
cryptography, or encoding. Those responsibilities remain with native APIs and
specialized libraries. See the project scope to understand
these decisions.