Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

detect-europe-js

faisalman1mMIT0.1.2TypeScript support: included

Detect if a user is from a country around the European Union (EU) area

ua-parser-js, detect-europe-js, detect-country, timezone, europe, eu, eea, efta, schengen, gdpr, dma, dsa, dga, data-act, ai-act, cybersecurity-act

readme

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
}