Skip to main content

getOS

A function that returns the OS value based on userAgent.

  • server: Server environment
  • ios: iOS environment
  • android: Android environment
  • otherMobile: Other mobile devices (e.g., BlackBerry)
  • web: Web environment

Code

🔗 View source code


Interface

typescript
function getOS(): "server" | "ios" | "android" | "otherMobile" | "web"

Usage

typescript
import { getOS } from '@modern-kit/utils';

const os = getOS();