Lightning fast longitude and latitude lookup for country and state codes.
Install
npm install geos-major --save
Country Lookup
var geos = geo = geos;console; /* results: countryCode: 'US', countryName: 'United States', currency: 'USD,USN,USS', continent: 'Americas', subContinent: 'Northern America', phoneCode: '1', latitude: 38, longitude: -97} */
CloudFlare Lookup
var geos = cf_country = reqheaders'cf-ipcountry' geo = geos; // accessed from the USAconsole; // countryCode: 'US', countryName: 'United States', ...
State Lookup
Includes regions: AA, AE, AP, AS, FM, GU, MH, MP & PR
var geos = geo = geos;console; // { "name":"Texas", "latitude": 31.1060, "longitude": -97.6475 }
Major attributions
- Country data: sindresorhus/1341699 and mledoze/countries
- State data: maxmind
- State data: mshafrir gist