An ECMAScript module for runtime information.
| Runtime \ Source | GitHub Raw | JSR | NPM |
|---|---|---|---|
| Bun >= v1.1.0 | ❌ | ✔️ | ✔️ |
| Deno >= v2.1.0 | ✔️ | ✔️ | ✔️ |
| NodeJS >= v20.9.0 | ❌ | ✔️ | ✔️ |
This does not request any runtime permission.
- GitHub Raw
https://raw.githubusercontent.com/hugoalh/runtime-info-es/{Tag}/mod.ts - JSR
jsr:@hugoalh/runtime-info[@{Tag}] - NPM
npm:@hugoalh/runtime-info[@{Tag}]
Note
- It is recommended to include tag for immutability.
- These are not part of the public APIs hence should not be used:
- Benchmark/Test file (e.g.:
example.bench.ts,example.test.ts). - Entrypoint name or path include any underscore prefix (e.g.:
_example.ts,foo/_example.ts). - Identifier/Namespace/Symbol include any underscore prefix (e.g.:
_example,Foo._example).
- Benchmark/Test file (e.g.:
| Name | Path | Description |
|---|---|---|
. |
./mod.ts |
Default. |
-
const runtimeArch: RuntimeArch | null;
-
const runtimeName: RuntimeName | null;
-
const runtimeIsCompatibleNode: boolean;
-
const runtimeIsCompatibleTypeScriptFull: boolean;
-
const runtimeIsCompatibleTypeScriptLite: boolean;
-
const systemName: SystemName | null;
-
type RuntimeArch = | "arm" | "arm64" | "loong64" | "mips" | "mipsel" | "ppc" | "ppc64" | "riscv64" | "s390" | "s390x" | "x64" | "x86";
-
type RuntimeName = | "browser" | "bun" | "cloudflare-workers" | "deno" | "nodejs";
-
type SystemName = | "aix" | "android" | "chromeos" | "chromiumos" | "cygwin" | "freebsd" | "haiku" | "illumos" | "ios" | "linux" | "macos" | "netbsd" | "openbsd" | "solaris" | "windows";
Note
- For the full or prettier documentation, can visit via: