- Before: Flat
utils/directory with mixed concerns - After: Modular
modules/structure with domain-specific organization - Impact: Better maintainability, tree-shaking support, and extensibility
- IP Detection & VPN Bypass: Advanced IP detection with WebRTC leaks
- Enhanced Location Module: Timezone, language, and geolocation support
- Improved Browser Detection: Incognito mode detection
- Better Network Information: Enhanced connection details
- Enhanced metadata and documentation
- Comprehensive development scripts
- Optimized keywords for better discoverability
- Better exports configuration for tree-shaking
src/
├── modules/ # 🆕 Organized by domain
│ ├── os/ # Operating System detection
│ │ ├── detector.ts
│ │ ├── types.ts
│ │ └── index.ts
│ ├── browser/ # Browser detection & capabilities
│ │ ├── detector.ts
│ │ ├── types.ts
│ │ └── index.ts
│ ├── device/ # Device hardware & battery
│ │ ├── detector.ts
│ │ ├── battery.ts
│ │ ├── getDeviceId.ts
│ │ ├── types.ts
│ │ └── index.ts
│ ├── network/ # Network information
│ │ ├── detector.ts
│ │ ├── types.ts
│ │ └── index.ts
│ ├── fingerprint/ # Device fingerprinting
│ │ ├── generator.ts
│ │ ├── types.ts
│ │ └── index.ts
│ ├── user-agent/ # User agent parsing
│ │ ├── detector.ts
│ │ ├── types.ts
│ │ └── index.ts
│ └── location/ # 🆕 Location & IP detection
│ ├── detector.ts
│ ├── types.ts
│ ├── index.ts
│ └── README.md
├── core/ # Main device info aggregator
├── types/ # Centralized type exports
└── index.ts # Clean public API
src/utils/directory (all files moved to modules)src/types/device-info.ts(consolidated intosrc/types/index.ts)
import { getIPInfo } from "@marufme/device-key";
const ipInfo = await getIPInfo();
console.log(ipInfo);
/*
{
publicIP: "203.0.113.1", // VPN IP
realIP: "192.168.1.100", // Real IP (if detected)
isVPN: true, // VPN detected
isProxy: false, // Proxy detected
isTor: false, // Tor detected
country: "United States", // Location
city: "New York",
isp: "NordVPN", // VPN provider
confidence: 0.7 // Detection confidence
}
*/Detection Methods:
- WebRTC IP Detection: ~70-80% VPN bypass rate
- VPN/Proxy Detection: ~85-90% accuracy for major services
- DNS Leak Detection: ~60-70% detection rate
- Geolocation Analysis: Country, city, ISP information