New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

in-us

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

in-us

Utility to determine if a user is in the United States, without an HTTP request or IP address

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

🌎 in-us

Utility to determine if a user is in the United States
without an HTTP request or IP address.


It uses the browser's timezone (via jstz and locale (navigator.languages) to infer whether someone is in United States. This project is inspired by in-eu by Segment.

Getting Started

Installation

Install with npm:

npm install --save in-us

Or with yarn:

yarn add in-us

Usage

inUS

import inUS from 'in-us'

inUS()
// => true | false

isInUSTimezone

import { isInUSTimezone } from 'in-us'

/*
  Only checks the browser timezone.
  e.g. America/Chicago
*/

isInUSTimezone()
// => true | false

isUSLocale

import { isUSLocale } from 'in-us'

/*
  Only uses the browser's language/locale
  e.g. es-US (spanish from United Staes)
*/

isUSLocale()
// => true | false

Contributing

All contributions are super welcome! in-us is MIT-licensed.

Keywords

usa

FAQs

Package last updated on 08 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts