get the global-runtime-object of the given javascript environment RUNTIME enum.
if you acquire the global-runtime-object of an environment that is not supported by your actual current environment, then the returned value will be undefined.
undefined
import { assertEquals } from "jsr:@std/assert"import process from "node:process" // this works in deno 2.0assertEquals(getRuntime(RUNTIME.DENO), Deno)assertEquals(getRuntime(RUNTIME.NODE), process)assertEquals(getRuntime(identifyCurrentRuntime()), Deno) Copy
import { assertEquals } from "jsr:@std/assert"import process from "node:process" // this works in deno 2.0assertEquals(getRuntime(RUNTIME.DENO), Deno)assertEquals(getRuntime(RUNTIME.NODE), process)assertEquals(getRuntime(identifyCurrentRuntime()), Deno)
get the global-runtime-object of the given javascript environment RUNTIME enum.
if you acquire the global-runtime-object of an environment that is not supported by your actual current environment, then the returned value will be
undefined
.