country-list-with-dial-code-and-flag
Country list with dial code and flag
Keywords
countryflagdial codephonecountry codenpmjavascript
INSTALL
Type:
<script src=" https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag@5.1.0/dist/main.min.js "></script>
No default JS file set by the package author so the URL is guessed. You can always browse all package files to use another one.
Country list with dial code and flag
This package provide all country list with their flag emoji, flag svg and dial number code.
Full Documentation
Installation
Via NPM
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>
CountryList.findByCurrencyCode('TRY')
// Response => Array<Country>
CountryList.findOneByCurrencyCode('TRY')
// Response => Country
Via CDN
<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
With specific version number
https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag@5.0.4/dist/main.js
Country Flag SVG (optional)
<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>
Development
Want to contribute? Great! Fork the repo and create PR to us.