@lemmmy/geoip2-downloader

1.0.1 • Public • Published

GeoIP2 Downloader

This module is a simple downloader for the MaxMind GeoIP2 database. It is extracted from my fork of svtslv's geoip2-cli project, and is intended to be used in conjunction with the maxmind module.

Only downloads the database, does not do any lookups or conversions. Currently only downloads to a file.

This is an ES module.

Installation

yarn add @lemmmy/geoip2-downloader

Examples

import { downloadGeoip2 } from "@lemmmy/geoip2-downloader";

await downloadGeoip2
  .download({
    licenseKey:   process.env.MAXMIND_LICENSE_KEY,
    edition:      "city", // One of: "city", "country", "asn"
    downloadPath: "/geoip-databases/", // Directory to download to, will be created with mkdirp
    date:         "", // Optional, defaults to latest
  })
  .then(path => console.log(path));

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @lemmmy/geoip2-downloader

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

6.11 kB

Total Files

7

Last publish

Collaborators

  • lemmmy