How to use the maxmind.init function in maxmind

To help you get started, we’ve selected a few maxmind examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github runk / node-maxmind / examples / city.js View on Github external
var maxmind = require('maxmind');
maxmind.init(__dirname + '/GeoLiteCity.dat');

// The returned location object has the following properties:
// countryCode, countryName, region, city, latitude, longitude
// postalCode, metroCode, dmaCode, areaCode
console.log('Location:', maxmind.getLocation('66.6.44.4'));
github runk / node-maxmind / examples / country.js View on Github external
var maxmind = require('maxmind');
maxmind.init(__dirname + '/GeoIP.dat');

console.log('Country:', maxmind.getCountry('66.6.44.4'));
github runk / node-maxmind / examples / asn.js View on Github external
var maxmind = require('maxmind');
maxmind.init(__dirname + '/GeoIPASNum.dat');

console.log('ASN:', maxmind.getOrganization('66.6.44.4'));
github runk / node-maxmind / examples / time_zone.js View on Github external
var maxmind = require('maxmind');
var timeZone = require('maxmind/lib/time_zone');

maxmind.init(__dirname + '/GeoLiteCity.dat');

var location = maxmind.getLocation('66.6.44.4');

console.log('countryCode\t', location.countryCode);
console.log('countryName\t', location.countryName);
console.log('timeZone\t', timeZone(location.countryCode, location.region));
github runk / node-maxmind / examples / distance.js View on Github external
var maxmind = require('maxmind');
maxmind.init(__dirname + '/GeoLiteCity.dat');

var fromLocation = maxmind.getLocation('66.6.44.4');
var toLocation = maxmind.getLocation('213.180.193.3');

console.log('From:\t', fromLocation.countryName, fromLocation.city);
console.log('To:\t', toLocation.countryName, toLocation.city);
console.log('Dist:\t', toLocation.distance(fromLocation));

maxmind

IP lookup using Maxmind databases

MIT
Latest version published 25 days ago

Package Health Score

86 / 100
Full package analysis