@marandino/tz-country-code
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@marandino/tz-country-code

Automatically detect a user's country based on their timezone, providing an easy and efficient way to get location information without relying on IP addresses.

Installation

npm install @marandino/tz-country-code

or

yarn add @marandino/tz-country-code

Usage

import { getCountryCode } from "@marandino/tz-country-code";

// Get the country code (e.g., 'US')
const countryCode = getCountryCode("code");
console.log(countryCode);

// Get the country name (e.g., 'United States')
const countryName = getCountryCode("name");
console.log(countryName);

License

MIT

Package Sidebar

Install

npm i @marandino/tz-country-code

Weekly Downloads

10

Version

1.0.2

License

MIT

Unpacked Size

45.5 kB

Total Files

7

Last publish

Collaborators

  • marandino