Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geoip-lite

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoip-lite - npm Package Compare versions

Comparing version 1.1.9 to 1.2.0

3

lib/geoip.js

@@ -110,3 +110,4 @@ var fs = require('fs');

geodata.metro = locBuffer.readInt32BE((locId * locRecordSize) + 12);
geodata.city = locBuffer.toString('utf8', (locId * locRecordSize) + 16, (locId * locRecordSize) + locRecordSize).replace(/\u0000.*/, '');
geodata.zip = locBuffer.readInt32BE((locId * locRecordSize) + 16);
geodata.city = locBuffer.toString('utf8', (locId * locRecordSize) + 20, (locId * locRecordSize) + locRecordSize).replace(/\u0000.*/, '');
}

@@ -113,0 +114,0 @@

{
"name" : "geoip-lite",
"version" : "1.1.9",
"version" : "1.2.0",
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind",

@@ -11,3 +11,3 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"],

"repository" : { "type": "git", "url": "git://github.com/bluesmoon/node-geoip.git" },
"engines" : { "node": ">=0.6.3" },
"engines" : { "node": ">=5.10.0" },
"scripts": {

@@ -14,0 +14,0 @@ "test": "nodeunit --reporter=minimal test/tests.js",

@@ -19,3 +19,3 @@ GeoIP-lite

Both IPv4 and IPv6 addresses are supported, however since the GeoLite IPv6 database does not currently contain any city or region
information, city and region lookups are only supported for IPv4.
information, city, region and postal code lookups are only supported for IPv4.

@@ -49,7 +49,9 @@ philosophy

console.log(geo);
{ range: [ 3479299040, 3479299071 ],
{ range: [ 3479297920, 3479301339 ],
country: 'US',
region: 'CA',
city: 'San Francisco',
ll: [37.7484, -122.4156] }
region: 'TX',
city: 'San Antonio',
ll: [ 29.4889, -98.3987 ],
metro: 641,
zip: 78218 }
```

@@ -100,3 +102,5 @@

city: "City Name", // This is the full city name
ll: [<latitude>, <longitude>] // The latitude and longitude of the city
ll: [<latitude>, <longitude>], // The latitude and longitude of the city
metro: <metro code>, // Metro code
zip: <postal code> // Postal code (IPv4 only)
}

@@ -103,0 +107,0 @@ ```

@@ -372,2 +372,3 @@ // fetches and converts maxmind lite databases

var city = fields[3];
var zip = parseInt(fields[4]);
var lat = Math.round(parseFloat(fields[5]) * 10000);

@@ -388,4 +389,8 @@ var lon = Math.round(parseFloat(fields[6]) * 10000);

b.write(city, 16);
if(zip){
b.writeInt32BE(zip, 16);
}
b.write(city, 20);
fs.writeSync(datFile, b, 0, b.length, null);

@@ -392,0 +397,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc