npm.io
0.4.0 • Published 2h ago

@hugoalh/runtime-info

Licence
MIT
Version
0.4.0
Deps
0
Size
13 kB
Vulns
0
Weekly
0
Stars
1

Runtime Info (ES)

MIT

DistBoard @hugoalhGitHubJSRNPM

An ECMAScript module for runtime information.

Runtime Targets

Any runtime which support ECMAScript should able to use this; These runtimes are officially supported:

Runtime Permissions

This does not request any runtime permission.

Sources & Entrypoints

  • 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}]
Name Path Description
. ./mod.ts Default.

  • Different runtimes have vary support for the sources and entrypoints, visit the runtime documentation for more information.
  • 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).

APIs

  • const runtimeArch: RuntimeArch | null;
  • const runtimeName: RuntimeName | null;
  • const runtimeIsCompatibleNode: boolean;
  • const runtimeIsCompatibleTypeScript: TypeScriptCompatibleStatus;
  • 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";

Keywords