Comparing version 0.4.3 to 0.4.4
@@ -9,3 +9,2 @@ var Database = require('./database'), | ||
var lookupOrg = require('./lookup/organization'); | ||
// var lookupSpd = require('./lookup/speed'); | ||
var ip = require('./ip'); | ||
@@ -273,3 +272,2 @@ | ||
DatabaseInfo.ORG_EDITION_V6, | ||
DatabaseInfo.ORG_EDITION_V6, | ||
DatabaseInfo.ISP_EDITION_V6, | ||
@@ -280,3 +278,3 @@ DatabaseInfo.DOMAIN_EDITION_V6, | ||
DatabaseInfo.NETSPEED_EDITION_REV1_V6, | ||
DatabaseInfo.USERTYPE_EDITION_v6, | ||
DatabaseInfo.USERTYPE_EDITION_V6, | ||
DatabaseInfo.REGISTRAR_EDITION_V6, | ||
@@ -288,1 +286,19 @@ DatabaseInfo.LOCATIONA_EDITION_V6 | ||
}; | ||
exports.getNetSpeed = function(ipv4) { | ||
var db = _getDb([ | ||
DatabaseInfo.NETSPEED_EDITION_REV1 | ||
]); | ||
return lookupOrg(db, this.seekCountry(db, ipv4)); | ||
}; | ||
exports.getNetSpeedV6 = function(ipv6) { | ||
var db = _getDb([ | ||
DatabaseInfo.NETSPEED_EDITION_REV1_V6 | ||
]); | ||
return lookupOrg(db, this.seekCountryV6(db, ipv6)); | ||
}; |
{ | ||
"name": "maxmind", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"homepage": "https://github.com/runk/node-maxmind", | ||
@@ -5,0 +5,0 @@ "description": "IP lookup using Maxmind databases", |
@@ -24,2 +24,3 @@ node-maxmind [![Build Status](https://travis-ci.org/runk/node-maxmind.png)](https://travis-ci.org/runk/node-maxmind) | ||
- Autonomous System Numbers (ASN) lookup by IP | ||
- Network speed lookup by IP | ||
@@ -50,2 +51,6 @@ Module written in pure Javascript with no dependencies. Being able to work with binary Maxmind databases it doesn't | ||
// Net Speed lookup | ||
maxmind.init('/path/to/GeoIPNetSpeedCell.dat'); | ||
var speed = maxmind.getOrganization('89.66.148.0'); | ||
``` | ||
@@ -52,0 +57,0 @@ |
@@ -11,2 +11,3 @@ var assert = require('assert'), | ||
const GEO_ASN_V6 = __dirname + '/dbs/GeoIPASNumv6.dat'; | ||
const GEO_NETSPEED = __dirname + '/dbs/GeoIPNetSpeedCell.dat'; | ||
@@ -195,2 +196,13 @@ | ||
describe('getNetSpeed()', function() { | ||
before(function() { | ||
assert.equal(ls.init(GEO_NETSPEED), true); | ||
}); | ||
it('should work fine with utf8', function() { | ||
assert.equal(ls.getOrganization('89.66.148.0'), 'Cable/DSL'); | ||
}); | ||
}); | ||
describe('getOrganizationV6()', function() { | ||
@@ -197,0 +209,0 @@ before(function() { |
188678
7371
140
40