JavaScript Runtime and OS Environment Detector

JSON →
library 1.1.0 ·javascript
verified May 27, 2026

The `environment` package provides a lightweight and robust utility for runtime detection of the JavaScript execution context. It allows developers to programmatically determine whether their code is running in a web browser, Node.js, Bun, Deno, Electron, jsdom, or various Web Worker environments (dedicated, shared, service). Additionally, it offers checks for common operating systems like macOS, Windows, Linux, iOS, and Android, introduced in version 1.1.0. The current stable version is 1.1.0, with a conservative release cadence that suggests stability. Its primary differentiator is its comprehensive and accurate detection logic for a wide array of JavaScript runtimes and host environments, making it useful for environment-specific configurations or feature toggles, though the documentation encourages preferring conditional exports and imports where possible for better optimization.

total hits 8
actors 4 distinct systems
last hit 2d ago AhrefsBot
GPTBot
2
Script
1
Search engines
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany