Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

countries-and-timezones

Package Overview
Dependencies
Maintainers
1
Versions
33
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.

  • 3.7.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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 14 Oct 2024

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