diff --git a/lib/geoip-asn.js b/lib/geoip-asn.js index f309a70..7568905 100644 --- a/lib/geoip-asn.js +++ b/lib/geoip-asn.js @@ -1,20 +1,20 @@ -import MMDB from "mmdb-lib"; +import MMDB from "#core/mmdb"; import fs from "node:fs"; -import CacheLru from "#lib/cache/lru"; -import externalResources from "#lib/external-resources"; +import CacheLru from "#core/cache/lru"; +import externalResources from "#core/external-resources"; const cache = new CacheLru( { "maxSize": 1000 } ); var mmdb; -const resource = externalResources.add( "softvisio-node/core/resources/geolite2-country", import.meta.url ).on( "update", () => ( mmdb = null ) ); +const resource = externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url ).on( "update", () => ( mmdb = null ) ); class GeoipCountry { constructor () {} // public get ( ipAddress ) { - mmdb ??= new MMDB( fs.readFileSync( resource.location + "/GeoLite2-Country.mmdb" ), { cache } ); + mmdb ??= new MMDB( fs.readFileSync( resource.location + "/GeoLite2-ASN.mmdb" ), { cache } ); return mmdb.get( ipAddress ); }