country-by-timezone
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

country-by-timezone

Build Status NPM Version GitHub

Get country by it's timezone.


Highlights

  • Dynamic JSON loading to reduce initial page load when used in webapps.
  • Simple and easy to use API.
  • The timezone data for the lib comes from IANA timezones database.
  • Fully supports ESM.

Installation

yarn add country-by-timezone

Usage/Examples

import getCountryByTimezone from "country-by-timezone";

getCountryByTimezone("Asia/Kolkata");
/*
Prints:

{
  countryCode: 'IN',
  countryName: 'India',
  timeZone: 'Asia/Kolkata',
  coordinates: [ '20.0000', '77.0000' ]
}
*/

API Reference

getCountryByTimezone(input)

Get a country by timezone.

input

type: string | string[]
desc: A timezone string or string[] ex: Asia/Kolkata


Support

You can support my work right here:


License

Rocktim Saikia © 2021 MIT

Package Sidebar

Install

npm i country-by-timezone

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

52.7 kB

Total Files

6

Last publish

Collaborators

  • rocktimsaikia