country-detector

Country detector middleware for Express.js via maxmind-db-reader

Usage no npm install needed!

<script type="module">
  import countryDetector from 'https://cdn.skypack.dev/country-detector';
</script>

README

Installation

npm install country-detector

Usage

app.use countryDetector.getMiddleware('./GeoLite2-City.mmdb', {
  cookieName: 'country'
  cookieMaxAge: 946707779241
  })

...

console.log req.country