country-state-lga-test is a utility library that provides functions to retrieve country-specific information such as capitals, states, country codes, and dial codes. Simplify your application's country-related operations with this easy-to-use package. Per
npm install country-state-lga-testcountry-utils is a utility library that provides information about countries, including their capitals, states, country codes, and dial codes. It is designed to be used in JavaScript and TypeScript applications.
You can install country-utils using npm or yarn. Make sure you have Node.js installed on your machine.
`` shell``
npm install country-utils
or
` shell`
npm install country-utils
`ts
import { getCountryByCode, searchCountryByName } from 'country-utils';
const country = getCountryByCode('US');
console.log(country);
// Output: { name: 'United States', capital: 'Washington, D.C.', code: 'US', dialCode: '+1' }
const countryByName = searchCountryByName('Canada');
console.log(countryByName);
// Output: { name: 'Canada', capital: 'Ottawa', code: 'CA', dialCode: '+1' }
``