-
Notifications
You must be signed in to change notification settings - Fork 129
/
index.js
35 lines (29 loc) · 996 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var path = require('path'),
read = require('fs').readFileSync;
var binding = require('bindings')('native.node');
var version = JSON.parse(read(path.resolve(__dirname, './package.json'))).version;
// Native classes
exports.native = binding;
// Libraries
exports.NetSpeedCell = require('./lib/netspeedcell');
exports.NetSpeed = require('./lib/netspeed');
exports.Country6 = require('./lib/country6');
exports.Country = require('./lib/country');
exports.Region = require('./lib/region');
exports.City6 = require('./lib/city6');
exports.City = require('./lib/city');
exports.Org = require('./lib/org');
// Utilities
exports.check = binding.check;
exports.isString = binding.isString;
exports.utils = {
check: binding.check,
isString: binding.isString
}
// Versions
exports.version = 'v' + version;
exports.libgeoip = 'v' + binding.libgeoip;
exports.versions = {
'geoip': version,
'libgeoip': binding.libgeoip
};