The plugin contains geo-location functionality and geo-ip matching. Behind the scenes, it uses geoip-lite
and geoip-ultralight
as data sources. Since all geo-location data is loaded in-memory, the plugin will add
roughly 70MB
of RAM and 2-3 second delay to your application.
By default, the plugin will auto-load geoip-ultralight
at boot time, and auto-load geoip-light
at the time
of the first IP lookup.
npm i --save thorin-plugin-geo@1.x
'use strict'; // app.js entry file const thorin = require('thorin'); thorin.addPlugin(require('thorin-plugin-geo')); // <- add this line thorin.run((err) => {});
code,name
containing every country on Earth.
code,name
representing all the regions of a country.
code
the 2-letter country codename
the country namelat
the country latitudelon
the country longituderegion
a code,name
entry of the regioncity
the name of the cityfull
the full geo representation (city, region, country)code
the 2-letter country codeiso
the 3-letter country codecontinent
the 2-letter continent codename
the country namepluginObj.lookup
that will fetch information about the intent's client IP address.
If a callback function is provided, it will use it, otherwise returns a promise.
pluginObj.lookupCountry
that will return country information about the intent's client IP address
You can always create a new issue on GitHub or contact one of the core founders by chat.