@treasurechic/country-detail

1.0.6 • Public • Published

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

Package Sidebar

Install

npm i @treasurechic/country-detail

Weekly Downloads

2

Version

1.0.6

License

ISC

Unpacked Size

179 kB

Total Files

10

Last publish

Collaborators

  • treasurechic