1.0.6 • Published 3 years ago
@treasurechic/country-detail v1.0.6
@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-detailyarn add @treasurechic/country-detailimport 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;
}