1.1.1 • Published 24 days ago

country-notes v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days ago

country-notes

Utility to fetch country codes viz ISO2, ISO3 and Phone code of all the countries listed in http://countrycode.org/.

Exposes the below APIs:

  • Pass in any of the CountryName,PhoneCode,ISO2/ISO3 country code to get other details of the country.
  • Get Name of country.
  • Get ISO2 country code.
  • Get ISO3 country code.
  • Get Phone code of country.

Installation

pnpm i country-notes
# or
npm i country-notes
# or
yarn add country-notes

Examples

import CountryNotes from 'country-notes'

CountryNotes.getAll() // Returns an array of country information
CountryNotes.getTotal() // Return total number of countries
CountryNotes.findByName('China') // Return country information by name
CountryNotes.excludeByNames(['China', 'India']) // Returns an array of country information by excluding names
CountryNotes.findByCode('CN') // Return country information by ISO2/ISO3 Code
CountryNotes.filterByCodes(['CN', 'IND']) // Returns an array of country information by ISO2/ISO3 Codes
CountryNotes.excludeByCodes(['CN', 'IND']) // Returns an array of country information by excluding ISO2/ISO3 Codes
CountryNotes.findByPhoneCode('86') // Return country information by Phone Code
CountryNotes.excludeByPhoneCodes(['86', '91']) // Returns an array of country information by excluding Phone Codes

Contributing

License

MIT

1.1.1

24 days ago

1.1.0

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.4

2 months ago

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.1-4

2 months ago