Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'));
var vows = require('vows'),
geoip = require('geoip-lite'),
maxmind = require('maxmind'),
filter_helper = require('./filter_helper');
maxmind.init(['test/maxmind/GeoIPCity.dat', 'test/maxmind/GeoIPASNum.dat']);
var ip1 = '91.121.153.187';
var ip1_res = geoip.lookup(ip1);
var ip1_res_maxmind = maxmind.getLocation(ip1);
var ip2 = '82.66.65.173';
var ip2_res = geoip.lookup(ip2);
var ip2_res_maxmind = maxmind.getLocation(ip2);
vows.describe('Filter Geoip ').addBatch({
'normal': filter_helper.create('geoip', 'ip', [
{
'titi': 'tata'
},
{
'titi': 'tata',
'ip': 'toto'
},
{
'titi': 'tata',
var vows = require('vows'),
geoip = require('geoip-lite'),
maxmind = require('maxmind'),
filter_helper = require('./filter_helper');
maxmind.init(['test/maxmind/GeoIPCity.dat', 'test/maxmind/GeoIPASNum.dat']);
var ip1 = '91.121.153.187';
var ip1_res = geoip.lookup(ip1);
var ip1_res_maxmind = maxmind.getLocation(ip1);
var ip2 = '82.66.65.173';
var ip2_res = geoip.lookup(ip2);
var ip2_res_maxmind = maxmind.getLocation(ip2);
vows.describe('Filter Geoip ').addBatch({
'normal': filter_helper.create('geoip', 'ip', [
{
'titi': 'tata'
},
{
'titi': 'tata',
'ip': 'toto'
},
{
'titi': 'tata',
'ip': ip1
},
{
'titi': 'tata',
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));
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));
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));