0.0.10 • Published 8 months ago

ts-country v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Installation

Using npm:

npm install ts-country

or using yarn:

yarn add ts-country

or using pnpm:

pnpm add ts-country

Usage

FunctionDescription
getCountryRetrieves detailed information about a specific country.
getCurrencyProvides currency codes for a given country code.
getLanguageRetrieves detailed language information for a specific country code.
getCapitalRetrieves the capital cities of various countries.

getCountry

Retrieves detailed information about a specific country.

import { getCountry } from "ts-country";

const countryInfo = getCountry() // Returns {
//   capital: "Washington, D.C.",
//   currency: { USD: "USD  -> United States Dollar" },
//   continent: "North America",
//   languages: { en: { name: "English", native: "English" } },
//   name: "United States",
//   native: "United States",
//   phone: [1],
//   continents: ["North America"],
//   emoji: "🇺🇸",
//   timezone: "America/New_York",
//   gmtoffset: "UTC-05:00",
//   geonameId: 6252001
//   fipsCode: "US",
//   isoNumeric: "840",
//   currencySymbol: "$",,
//   area: 9372610,
//   governmentType: Federal republic,
//   coastline: 19.924
// }

getCurrency

Provides currency codes for a given country code.

import { getCurrency } from "ts-country";

const currencyCodes = getCurrency("US");

// Accessing USD currency code
const usdCode = currencyCodes.USD; // Returns "USD  -> United States Dollar"

getLanguage

Retrieves detailed language information for a specific country code.

import { getLanguage } from "ts-country";

const languageInfo = getLanguage("US");

// Accessing English language information
const englishInfo = languageInfo.en; // Returns { name: "English", native: "English" }

getCapital

Retrieves the capital cities of various countries.

import { getCapital } from "ts-country";


const capitals = getCapital();
// Accessing capital of the United States
const usCapital = capitals.US.capital; // Returns "Washington, D.C."

License

This project is licensed under the MIT License - see the LICENSE

Contributing

If you'd like to contribute, please fork the repository and create a pull request. We welcome improvements and bug fixes.

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago