iso-country
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

iso-country

Search for Countries By Iso Code

NPM version

How to Use

Import the function and type into your application.

import { Country, isoCountry } from 'iso-country';

Pass either an ISO3166 Alpha 2 (e.g. US) or Alpha 3 (e.g. USA) code into the isoCountry function.

const unitedStates: Country = isoCountry('us');
console.log(unitedStates);

/*
{
  code: 'US',
  iso2: 'US',
  iso3: 'USA',
  name: 'United States',
  localName: 'United States',
  emoji: '🇺🇸',
  emojiCode: '1F1FA 1F1F8'
}
*/

License

Unless stated otherwise all works are:

  • Copyright © 2019+ Ryan Brady

and licensed under:

Package Sidebar

Install

npm i iso-country

Weekly Downloads

1,119

Version

3.0.0

License

MIT

Unpacked Size

96 kB

Total Files

18

Last publish

Collaborators

  • ryanbradynd05