Skip to main content
Home
Works with
This package works with Node.js, Deno, Browsers
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

function detect
detect(): "browser" | "node" | "deno" | null

A function that detects which runtime the code is running on.

Return Type

"browser" | "node" | "deno" | null

The name of the runtime being run on, or null if the runtime could not be detected.

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";