Environment Detection
Made Simple

Comprehensive, lightweight, and zero-dependency environment detection library for JavaScript/TypeScript applications.

Live Environment Detection

Runtime
Browser
Device
Connection

Powerful Features

Everything you need for environment detection

Zero Dependencies

No external dependencies. Keep your bundle size minimal and reduce security vulnerabilities.

TypeScript Ready

Full TypeScript support with comprehensive type definitions and IntelliSense.

Tree-Shakeable

Import only what you need. Webpack and Vite will optimize your bundle automatically.

Comprehensive Detection

Detect runtime, browser, OS, device, network, and features in one unified API.

Cross-Platform

Works in browsers, Node.js, Bun, Deno, Electron, and more runtime environments.

Performance Optimized

Automatic caching and lazy evaluation for optimal performance in production.

API Reference

Complete list of available functions

Runtime Detection

  • isBrowser()
  • isNode()
  • isBun()
  • isDeno()
  • isElectron()
  • isReactNative()

Browser Detection

  • isChrome()
  • isFirefox()
  • isSafari()
  • isEdge()
  • getBrowser()

Device Detection

  • isMobile()
  • isTablet()
  • isDesktop()
  • isTouchDevice()
  • getDeviceType()

Code Examples

See how easy it is to use EnvScout

Basic Usage

import { isBrowser, getEnvironmentInfo, isEnvironment } from '@oxog/env-scout';

// Simple checks
if (isBrowser() && isDarkMode()) {
  // Apply dark theme
}

// Multiple conditions
if (isEnvironment(['browser', 'mobile', 'online'])) {
  // Mobile browser with connection
}

// Get complete info
const env = getEnvironmentInfo();
console.log(env.runtime); // 'browser'

Platform-Specific Code

import { isEnvironment, getOS } from '@oxog/env-scout';

function getPlatformPath() {
  if (isEnvironment(['electron', 'windows'])) {
    return 'C:\\Program Files\\MyApp';
  } else if (isEnvironment(['electron', 'macos'])) {
    return '/Applications/MyApp.app';
  }
  return './';
}

Feature Detection

import { checkFeatureSupport } from '@oxog/env-scout';

const features = checkFeatureSupport(['webgl', 'webassembly']);

if (features.webgl && features.webassembly) {
  // Load advanced features
} else {
  // Load fallback version
}
1.0.1
Current Version
0
Dependencies
100%
Type Safety
MIT
License

Ready to Get Started?

Start detecting environments with just a few lines of code.