Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@segment/in-eu

Package Overview
Dependencies
Maintainers
72
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/in-eu - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

package.json
{
"name": "@segment/in-eu",
"version": "0.1.0",
"version": "0.1.1",
"description": "Privacy conscious EU detection browser library",

@@ -10,3 +10,3 @@ "keywords": ["gdpr", "europe", "timezone", "locale"],

},
"author": "Netto Farah<netto@segment.com>",
"author": "Netto Farah <netto@segment.com>",
"license": "MIT",

@@ -13,0 +13,0 @@ "dependencies": {

@@ -6,3 +6,4 @@ # 🇪🇺 in-eu

It uses the browser's timezone (via the brilliant [jstz](https://github.com/iansinnott/jstz) and locale (`navigator.languages`) to infer whether someone is in the EU. It trades absolute accuracy for a cautious approach that's more lightweight and respectful of end-user privacy.
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.

@@ -16,9 +17,33 @@ ## Usage

```javascript
import inEU, { isInEUTimezone, isEULocale } from '@segment/in-eu'
import inEU from '@segment/in-eu'
inEU() // same as (isInEUTimezone() || isEULocale())
inEU()
// => true | false
```
// or
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 phisically 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
```

@@ -25,0 +50,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc