0.0.2 • Published 7 years ago
in-us v0.0.2
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-usOr with yarn:
yarn add in-usUsage
inUS
import inUS from 'in-us'
inUS()
// => true | falseisInUSTimezone
import { isInUSTimezone } from 'in-us'
/*
Only checks the browser timezone.
e.g. America/Chicago
*/
isInUSTimezone()
// => true | falseisUSLocale
import { isUSLocale } from 'in-us'
/*
Only uses the browser's language/locale
e.g. es-US (spanish from United Staes)
*/
isUSLocale()
// => true | falseContributing
All contributions are super welcome! in-us is MIT-licensed.