maxmind-loader

0.5.12 • Public • Published

maxmind-loader NPM version Build Status Dependency Status License

Get maxmind paid and lite geoip data updates

Install 🔨

npm install maxmind-loader

Usage 🔧

var maxloader = require('maxmind-loader');
 
maxloader(callback);
 
// default values shown
maxloader({
    license: undefined, // maxmind license string for paid data otherwise free version loaded
    day:     'tuesday', // day of the week to load for paid subscription
    edition: 132,       // paid subscription edition
    extract: true,      // extract compressed files
    dest:    '/tmp/'    // should load /tmp/GeoCityLite.dat, async operation
}, function (err, filepath) {
    if (err) {
        console.log(err);
    } else {
        console.log(filepath, 'loaded');
    }
});

Free Geo Data Example 🔧

var maxmind   = require('maxmind')
  , maxloader = require('maxmind-loader');
 
maxloader(function(error, filepath) {
    maxmind.init(filepath); // intialize with /tmp/GeoLiteCity.dat
});

Paid Geo Data Example 🔧

var options = { license: 'MAXMIND_LICENSE' };
 
maxloader(options, function(err, filepath) {
    if (err) {
        console.log(err);
    } else {
        maxmind.init(filepath, { memoryCache: true });
    }
})

License: MIT 🔓

Dependencies:

compress-buffer date-utils tar wgetjs

Development Dependencies:

grunt grunt-bump grunt-license license-md mocha should

Readme

Keywords

none

Package Sidebar

Install

npm i maxmind-loader

Weekly Downloads

0

Version

0.5.12

License

MIT

Last publish

Collaborators

  • angleman