Skip to main content
Home

Built and signed on GitHub Actions

constants to help determine the current runtime such as deno, bun, node, cloudflare, and browser.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.2.0)

@gnome/runtime-constants

logo Work less. Do more.

Overview

The runtime-constants module is helpful for JavaScript runtime detection which is useful for writing compatability layers in modules for different runtimes.

Basic Usage

import { RUNTIME, BUN, DENO, NODE, BROWSER, CLOUDFLARE } from "@gnome/runtime-constants";

console.log(RUNTIME);
console.log("bun", BUN);
console.log("deno", DENO);
console.log("node", NODE);
console.log("browser", BROWSER);
console.log("cloudflare", CLOUDFLARE);

MIT License

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";
or

Import directly with a jsr specifier

import * as runtime_constants from "jsr:@gnome/runtime-constants";

Add Package

pnpm i jsr:@gnome/runtime-constants
or (using pnpm 10.8 or older)
pnpm dlx jsr add @gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";

Add Package

yarn add jsr:@gnome/runtime-constants
or (using Yarn 4.8 or older)
yarn dlx jsr add @gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";

Add Package

vlt install jsr:@gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";

Add Package

npx jsr add @gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";

Add Package

bunx jsr add @gnome/runtime-constants

Import symbol

import * as runtime_constants from "@gnome/runtime-constants";