Skip to content

Latest commit

 

History

History
44 lines (23 loc) · 1.46 KB

README.md

File metadata and controls

44 lines (23 loc) · 1.46 KB

World Countries Info

Install

npm install @stacrypt/world-countries-info

This package helps you if you need the list of countries for your web app! This package provides you a complete list of countries in the world, and some useful functions.

Usage

import countries, { getCountry, getCountryByDialCode, getFullSvgUrl } from 'world-countries-info'


// An array of all countries you can use in any way!

countries.filter(country => country.emoji === "🇺🇸")


// Use this function to find the correct country based on it's name (english, and persian) or code (alpha2, alpha3, numeric) or even it's emoji!

const US = getCountry("US")


// Use this function to find the correct country based on it's dial code

const Netherlands = getCountryByDialCode(528)


// This function helps you get the full svg url from wikimedia

const USSvgUrl = US && getFullSvgUrl(US.svgUrl)

These packages/codes helped us with this package: