This package provide all country list with their flag emoji, flag svg and dial number code.
npm install country-list-with-dial-code-and-flag
import CountryList from 'country-list-with-dial-code-and-flag'
CountryList.getAll()
// Response => Array<Country>
CountryList.findOneByCountryCode('MM')
// Response => Country
CountryList.findOneByDialCode('+95')
// Response => Country
CountryList.findByDialCode('+95')
// Response => Array<Country>
CountryList.findByKeyword('united')
// Response => Array<Country>
<script src="https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag@latest/dist/main.js"></script>
https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag@latest/dist/main.js
https://cdn.jsdelivr.net/npm/[email protected]/dist/main.js
<script src="https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag/dist/country-flag-svg.js"></script>
<div id="flag"></div>
<script>
const mm = window.CountryList.findOneByCountryCode('mm')
document.getElementById('flag').innerHTML = window.CountryFlagSvg[mm.code]
</script>
Want to contribute? Great! Fork the repo and create PR to us.