is-browser
JSON →The `is-browser` package is a minimalist utility designed to determine if the current JavaScript execution environment is a web browser. It exports a single boolean value: `true` if executed in a browser context (detecting `window` and `document` globals), and `false` otherwise (typically in a Node.js environment). The package is at version `2.1.0` and has not received updates since 2018, indicating a mature, stable, but currently unmaintained codebase. Its primary use case is for simple conditional logic in universal JavaScript libraries that need to adapt behavior based on the runtime environment. Unlike more modern alternatives like `browser-or-node` (which offers checks for Web Workers, JSDOM, or Deno), `is-browser` provides only a basic browser vs. non-browser distinction. It has no external runtime dependencies, ensuring a minimal footprint.
Traffic · last 30 days ↑33% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇩🇪 Germany