
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Easily detect which JavaScript runtime is being used. Bun, Deno, Node.JS or browser.
Useful for packages or scripts to customize functionality of their code depending on the runtime being executed.
index.js
import { currentRuntime } from "runtimey";
console.log(currentRuntime);
shell
$ bun index.js && deno run index.js && node index.js
bun
deno
node
isBun
true
if the Bun runtime is being used.
isDeno
true
if the Deno runtime is being used.
isNode
true
if the Node.JS runtime is being used.
isBrowser
true
if running inside a browser.
currentRuntime
: "bun"
| "deno"
| "node"
| "browser"
| "unknown"
The name of the current runtime being used.
runtimeValue({ bun, deno, node, browser, default })
Returns the value according to the runtime being used.
index.js
import { runtimeValue } from "runtimey";
const val = runtimeValue({ bun: "RUNTIME_BUN", deno: "RUNTIME_DENO", node: "RUNTIME_NODE" });
console.log("Current runtime:", val);
shell
$ bun index.js && deno run index.js && node index.js
Current runtime: RUNTIME_BUN
Current runtime: RUNTIME_DENO
Current runtime: RUNTIME_NODE
isServiceWorker
true
if running in a worker environment.
This repository uses MIT License. See LICENSE for full license text.
FAQs
Easily detect which JavaScript runtime is being used.
The npm package runtimey receives a total of 5 weekly downloads. As such, runtimey popularity was classified as not popular.
We found that runtimey demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.