Skip to main content
Works with
This package works with Browsers, Deno, Node.js
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score100%
Published2 years ago (0.1.3)

Detect which runtime you are running in

runtime-detector

A package to detect which runtime you are executing in.

import { detect } from "@luca/runtime-detector";

const runtime = detect();
console.log(runtime); // "node" | "deno" | "browser" | null

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:@luca/runtime-detector

Import symbol

import { detect } from "@luca/runtime-detector";
or

Import directly with a jsr specifier

import { detect } from "jsr:@luca/runtime-detector";