New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

country-notes

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-notes

Find country codes, country phone codes, country time zone, ISO2 and ISO3 letter codes of countries. Resource from https://countrycode.org

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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

Keywords

ISO country

FAQs

Package last updated on 17 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts