express-geoip

2.4.0 • Public • Published

Express GeoIP

Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code for a request.

Usage

In app.js

var expressGeoIP = require('express-geoip');

app.use(expressGeoIP('US').getCountryCodeMiddleware);

Then, in your routes, check req.countryCode for the looked up country code.

History

1.2.0 - Added tests, new function signature

1.0.0 - Initial release

/express-geoip/

    Package Sidebar

    Install

    npm i express-geoip

    Weekly Downloads

    126

    Version

    2.4.0

    License

    MIT

    Unpacked Size

    13.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • mikemaccana