detect-europe-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

detectEurope.js

Detect if a user is from a country around the European Union (EU), EFTA, EEA, or Schengen area based on their timezone settings.

npm i detect-europe-js

* isFromEU(): boolean

European Union (EU) countries

* isFromEEA(): boolean

EU countries + Iceland, Liechtenstein and Norway

* isFromEFTA(): boolean

Switzerland + Iceland, Liechtenstein and Norway

* isFromSchengen(): boolean

Schengen countries (including Romania, Bulgaria, and several microstates)

Code Example

import { isFromEU } from 'detect-europe-js';

if(isFromEU()) {
    // show cookie banner
}

/detect-europe-js/

    Package Sidebar

    Install

    npm i detect-europe-js

    Weekly Downloads

    384,257

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    17.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • faisalman