amaran-light-cli
Version:
Command line tool for controlling Aputure Amaran lights via WebSocket to a local Amaran desktop app.
20 lines • 603 B
JavaScript
import geoip from 'geoip-lite';
export function getLocationFromIP(ip) {
// If no IP provided, use public IP via external service or fallback to localhost
// geoip-lite works best with public IPs
if (!ip || ip === '127.0.0.1' || ip === '::1') {
// Try to get public IP via external service
// For now, fallback to null
return null;
}
const geo = geoip.lookup(ip);
if (!geo)
return null;
return {
city: geo.city,
region: geo.region,
country: geo.country,
ll: geo.ll,
};
}
//# sourceMappingURL=geoipUtil.js.map