Socket
Socket
Sign inDemoInstall

countries-and-timezones

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

countries-and-timezones

Minimalistic library to work with countries and timezones data.


Version published
Weekly downloads
224K
increased by14.34%
Maintainers
2
Weekly downloads
 
Created

What is countries-and-timezones?

The 'countries-and-timezones' npm package provides utilities for working with country and timezone data. It allows you to retrieve information about countries, their timezones, and perform various operations related to timezones.

What are countries-and-timezones's main functionalities?

Get Country Information

This feature allows you to retrieve information about a specific country using its ISO 3166-1 alpha-2 code. The returned object includes details such as the country's name, timezones, and other relevant data.

const ctz = require('countries-and-timezones');
const country = ctz.getCountry('US');
console.log(country);

Get Timezone Information

This feature allows you to retrieve information about a specific timezone using its IANA timezone identifier. The returned object includes details such as the timezone's name, offset, and other relevant data.

const ctz = require('countries-and-timezones');
const timezone = ctz.getTimezone('America/New_York');
console.log(timezone);

Get All Countries

This feature allows you to retrieve a list of all countries supported by the package. The returned object includes details for each country.

const ctz = require('countries-and-timezones');
const countries = ctz.getAllCountries();
console.log(countries);

Get All Timezones

This feature allows you to retrieve a list of all timezones supported by the package. The returned object includes details for each timezone.

const ctz = require('countries-and-timezones');
const timezones = ctz.getAllTimezones();
console.log(timezones);

Get Timezones for a Country

This feature allows you to retrieve a list of all timezones for a specific country using its ISO 3166-1 alpha-2 code. The returned array includes details for each timezone.

const ctz = require('countries-and-timezones');
const timezones = ctz.getTimezonesForCountry('US');
console.log(timezones);

Other packages similar to countries-and-timezones

Keywords

FAQs

Package last updated on 11 Oct 2019

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

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