# @segment/in-eu

> Privacy conscious EU detection browser library

Latest version **0.4.0** (published 2023-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @segment/in-eu
pnpm add @segment/in-eu
yarn add @segment/in-eu
bun add @segment/in-eu
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-03-01 |
| First published | 2018-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 186 |
| Author | Netto Farah |
| Maintainers | anton-vylushchak, moyara2, sowjanyasegment, alayvora, pzawadzki, msaunders-segment, tw-dgarcia, nat-grid, bvakkalagadda, mbreske, nsandhu-segment, parag.panda, blangtwilio, ryanrouleau-segment, twjosiah, mcullenmeyer, nina-y, david.anusontarangkul.segment, mckern_segment, segment-admin, nainy.agrawal, tdibacco, sudojatin, nageshgolem, brandonheyer-segment, teganduong, alfrimpong, dobrin.ganev, ankit.gupta.unthinkable, marinhero, benattwilio, bharath.boregowda, conniechen, sungju.jin, pooyaj, yli119, ea_segment, emilyjia, kx-segment, cvillela_segment, xinghao.huang, harsh.vardhan, joe.ayoub.segment, gkochar123, rollcode, ariel.silvestri, cherylj-segment, leifdreizler, immanoj, aaronklish, michelr, maneesh.dharma29, msolorzano-segment, brianhumphreystwilio, jfehrman.segment, joetessy, pmunin, jalexy12, jbandi-twilio, prayansh-twilio, dominicbarnes, brandon.scott-segment, bgillan, phillip.thomas, ricardo.rossi, forgetfulfellow, fauzy.yy, mayur-pitale, dbaik-twilio-segment, seg-rustybailey, tanya.gupta.segment, pmiller-twilio, nevermore2022, aishikawaki, csayuso, mcoulibali, shupadhyay, swgupta, sumit1606, jahood-twilio, saisagarkappaganthula, dostwal, rmukundan, ngoldman-twilio, apareek-twilio, arubiochavez, shuvrajit9904, s3gm3nt, ama0223, tbrennanj, dangmai-segment, shraddha-twilio, taricjain, snehauppalapati, nitish.dubey, azhaotwilio, ryder.wendt, sa-jsooter, enyi.asonye, afsha-nazim-seg, akurapati, mschaszberger, lnamba, varadarajan-tw, seanhan-segment, replatero, sayan-das-in, justeen, sausingh, jgabe13, haeyoon.paik, kentrollins, meg1000, funlu, ashwitha.bg, whaider_twilio, tcgilbert, kevinburkesegment, felttrip, prabhnoor1997, akashyap91, connormarchand, clintz.seg, karimkeshwani, wally.tg, rhall-twilio, yash-twilio, brookstaylorjr, shayan-golafshani, lerahulram, shpankau, mugelstad, hdamani, brchristy, rrivera-segment, sethnutetwilio, fplinke, manali-bhosale, chtoombs, sethsegment, eric-hyde, elmoselyee, michaelghseg, jayakrishnannair, lateefat, maryam.sharif, wdbetts, ryanligon, sindhusegment, lfdelossantos, aramakrishnan, segment-camden, vbatanov, lluque-twilio, jair.aviles, pmaid, song4you, peterdemartini, emmy.byrne, vincen7tran, dean-huynh, cdignam-segment, abhinavsureka, rikezatsegment, arunlalam-segment, cjradek, neeharikakondipati, simpixelated, chihchun-twilio, acharles14, jyim008, seghungtran, tv0, hema-segment, oscb, krousseau, sachinwathore, fhalim-segment, cfree, hjoonpm, celine-segment, parsa-segment, pmcanseco-segment, ynguyen, masira, amillet89, cholt002, av-segment, aghotikar, vikrant-segment, larryatsegment, lbrink, shivpoojan-segment, ariel_segment, scruwys1, lew-gordon, kyliepedersen, jinapark, segmentio, rajulvadera, lpediredla, n2parko, sahilp, psankaranarayana, tyson_segment, bgamwell, jfabre-segment, uditmehta, salolivares, erikdw, chenxiangzhang, mericsson, prayansh-segmentt, andyguwc, jeremylarkin, bsneed, danieljackins, segment-seth, james9446, priscilla.giatti, kellylu, nlsun, drew-thompson, segment-jsingh, andrius-segment, valerieernst, khinkalilover, kelcook, alistairbarrell, gilomer, kiara.daswani, marcelopv, eric.rogner, steve_at_segment, kdharaiya, jon.anderson-at-segment.com, markzegarelli, stacy.song, niveda.balananthan, rexatsegment, nickaguilar, bradenbecker, reneewang, dan.lasky, sam.tapia, vikramkumar19, mpriyad25, jeremy.parker, khamidou-segment, smidges |
| Keywords | gdpr, europe, timezone, locale |

## Links

- npm: https://www.npmjs.com/package/@segment/in-eu
- Repository: https://github.com/segmentio/in-eu
- Homepage: https://github.com/segmentio/in-eu#readme
- Issues: https://github.com/segmentio/in-eu/issues
- npm.io page: https://npm.io/package/@segment/in-eu

## Dependencies (1)

- [jstz](https://npm.io/package/jstz.md) ^2.0.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2023-03-01
- 0.3.0 — 2019-10-05
- 0.2.1 — 2018-07-04
- 0.2.0 — 2018-05-23
- 0.1.3 — 2018-05-14
- 0.1.2 — 2018-05-14
- 0.1.1 — 2018-05-10
- 0.1.0 — 2018-05-05

## README

# 🇪🇺 in-eu
> Privacy conscious EU detection browser library

`in-eu` is a library for roughly detecting whether a website user is in the EU, without requiring a roundtrip to your server or a lookup against a GeoIP database. 

It uses the browser's timezone (via the brilliant [jstz](https://github.com/iansinnott/jstz) and [locale](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language) (`navigator.languages`) to infer whether someone is in the EU.
`in-eu` trades absolute accuracy for a cautious approach that's more lightweight and respectful of end-user privacy.

## Usage

```bash
$ npm install @segment/in-eu
```

```javascript
import inEU from '@segment/in-eu'

inEU()
// => true | false
```

or try one of the more specific helpers:

```javascript
import { isInEUTimezone } from '@segment/in-eu'

/*
 Only checks the browser timezone.
 Useful for checking if someone is physically present in the EU
*/

isInEUTimezone()
// => true | false
```

```javascript
import { isEULocale } from '@segment/in-eu'

/*
 Only uses the browser's language/locale
 Useful for checking if someone speaks an european language accounting
 for locale. e.g. pt-PT (portuguese from Portugal)
*/

isEULocale()
// => true | false
```

## License
in-eu is released under the MIT license.

---
_Source: https://npm.io/package/@segment/in-eu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
