This is a Nuxt module for device detection that provides a reactive `$device` object and `useDevice()` composable. It determines device type (mobile, tablet, desktop), operating system (iOS, Android, Windows, macOS, Linux), browser (Chrome, Firefox, Edge, Safari, Samsung), and crawler status by parsing the User-Agent header and/or CDN-provided headers (Amazon CloudFront, Cloudflare). The core detection logic is encapsulated in `src/runtime/generateFlags.ts`, which is a standalone, well-tested function. The module is built for Nuxt 3+ (ESM-only) and uses `crawler-user-agents` for crawler detection with a build-time generated regex for performance. The codebase is small, focused, and demonstrates good engineering practices with clean separation of concerns, comprehensive tests, and proper use of Nuxt module APIs.
DeviceKit is a Swift library that provides a value-type replacement for Apple's UIDevice class, enabling device detection across iOS, tvOS, and watchOS platforms. It identifies real devices and simulators (iPhone, iPad, iPod, Apple TV, Apple Watch) and exposes properties such as screen diagonal, aspect ratio, PPI, battery state, CPU, camera types, and hardware features (e.g., eSIM, 5G, USB-C, LiDAR, Apple Pencil support). The library uses a code generation pipeline: a Python template engine (GYB) processes a template file (Device.swift.gyb) to produce the main Swift source (Device.generated.swift), which is checked into the repository. The architecture is a single Swift framework with conditional compilation for each target OS, and it depends only on Apple's UIKit/WatchKit. The project is actively maintained with frequent releases aligned with Apple device launches, comprehensive tests, and CI across multiple simulator targets.