@zerodep/geo-country
TypeScript icon, indicating that this package has built-in type declarations

2.3.4 • Public • Published

@zerodep/geo-country

version language types license

CodeFactor Known Vulnerabilities

A parser to get country ISO codes and information from a country name or abbreviation; it will throw a ZeroDepError on failure.

Full documentation is available at the zerodep.app page.

geoCountryIso Examples

geoCountryIso('usa'); // 'US'
geoCountryIso('canada'); // 'CA'
geoCountryIso('great britain'); // 'GB'

geoCountry Examples

geoCountry(['es']);
// {
//   countryName: 'Spain',
//   countryIso2: 'ES',
//   countryIso3: 'ESP',
//   countryCode: 724,
// }

Unsuccessful Cases

geoCountryIso('unknown'); // thows ZeroDepError: Could not find a country for "UNKNOWN"

geoCountry('unknown'); // thows ZeroDepError: Could not find a country for "UNKNOWN"

/@zerodep/geo-country/

    Package Sidebar

    Install

    npm i @zerodep/geo-country

    Homepage

    zerodep.app

    Weekly Downloads

    1

    Version

    2.3.4

    License

    MIT

    Unpacked Size

    65.9 kB

    Total Files

    7

    Last publish

    Collaborators

    • cdepage