@treasurechic/country-detail
v1.0.6
Published
This package works by receiving either the country name or ISO to return the detailed country details, including flag, currency and its symbol.
Downloads
35
Maintainers
Readme
@treasurechic/country-detail
This package works by receiving either the country name or ISO to return the detailed country details, including flag, currency and its symbol.
Installation
The package can be installed via npm or yarn:
npm i @treasurechic/country-detail
yarn add @treasurechic/country-detail
import getCountryDetail from '@treasurechic/country-detail/lib';
// You can get the country detail as on object by following either of the examples below 👇️
getCountryDetail('NG');
//OR
getCountryDetail('NGA');
//OR
getCountryDetail('Nigeria');
Data structure for the response is displayed below 👇️.
{
iso2: string;
iso3: string;
latitude: number;
longitude: number;
name: string;
currency: {
code: string;
name: string;
symbol: string;
};
language: {
code: string;
name: string;
};
dialCode: string;
flag: string;
}