Comprehensive, lightweight, and zero-dependency environment detection library for JavaScript/TypeScript applications.
Everything you need for environment detection
No external dependencies. Keep your bundle size minimal and reduce security vulnerabilities.
Full TypeScript support with comprehensive type definitions and IntelliSense.
Import only what you need. Webpack and Vite will optimize your bundle automatically.
Detect runtime, browser, OS, device, network, and features in one unified API.
Works in browsers, Node.js, Bun, Deno, Electron, and more runtime environments.
Automatic caching and lazy evaluation for optimal performance in production.
Complete list of available functions
isBrowser()isNode()isBun()isDeno()isElectron()isReactNative()isChrome()isFirefox()isSafari()isEdge()getBrowser()isMobile()isTablet()isDesktop()isTouchDevice()getDeviceType()See how easy it is to use EnvScout
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'
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 './';
}
import { checkFeatureSupport } from '@oxog/env-scout';
const features = checkFeatureSupport(['webgl', 'webassembly']);
if (features.webgl && features.webassembly) {
// Load advanced features
} else {
// Load fallback version
}
Start detecting environments with just a few lines of code.