{"library":"environment","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"1.1.0","tags":["javascript","runtime","environment","env","execution","engine","platform","context","js","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install environment","imports":["import { isBrowser } from 'environment';","import { isNode } from 'environment';","import { isMacOs, isWindows } from 'environment';"]},{"cmd":"yarn add environment","imports":[]},{"cmd":"pnpm add environment","imports":[]}],"homepage":null,"github":"https://github.com/sindresorhus/environment","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/environment","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/environment/compatibility"}}