1.0.6 • Published 2 years ago

@treasurechic/country-detail v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@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;
}