Skip to content

hugoalh/runtime-info-es

Runtime Info (ES)

⚖️ MIT

GitHub: hugoalh/runtime-info-es JSR: @hugoalh/runtime-info NPM: @hugoalh/runtime-info

An ECMAScript module for runtime information.

🎯 Targets

Runtime \ Source GitHub Raw JSR NPM
Bun >= v1.1.0 ✔️ ✔️
Deno >= v2.1.0 ✔️ ✔️ ✔️
NodeJS >= v20.9.0 ✔️ ✔️

🛡️ Runtime Permissions

This does not request any runtime permission.

#️⃣ Sources

  • 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).

⤵️ Entrypoints

Name Path Description
. ./mod.ts Default.

🧩 APIs

  • 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

Packages

No packages published