An open API service indexing awesome lists of open source software.

https://github.com/necessarylion/country-list-with-dial-code-and-flag

Country Flag with Dial Number Code
https://github.com/necessarylion/country-list-with-dial-code-and-flag

country-codes country-flags dialcodes flag flags

Last synced: 10 days ago
JSON representation

Country Flag with Dial Number Code

Awesome Lists containing this project

README

        

# Country list with dial code and flag

[![npm version](https://badge.fury.io/js/country-list-with-dial-code-and-flag.svg)](https://badge.fury.io/js/country-list-with-dial-code-and-flag) ![ts](https://badgen.net/badge/Built%20With/TypeScript/blue) ![contributors](https://badgen.net/github/contributors/necessarylion/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](https://zin-kyaw-kyaw.gitbook.io/country-flags/)

## Installation

#### Via NPM

```sh
npm install country-list-with-dial-code-and-flag
```

```ts
import CountryList from 'country-list-with-dial-code-and-flag'

CountryList.getAll()
// Response => Array

CountryList.findOneByCountryCode('MM')
// Response => Country

CountryList.findOneByDialCode('+95')
// Response => Country

CountryList.findByDialCode('+95')
// Response => Array

CountryList.findByKeyword('united')
// Response => Array

CountryList.findByCurrencyCode('TRY')
// Response => Array

CountryList.findOneByCurrencyCode('TRY')
// Response => Country
```

#### Via CDN

```html

https://cdn.jsdelivr.net/npm/country-list-with-dial-code-and-flag@latest/dist/main.js
```

##### With specific version number

```bash
https://cdn.jsdelivr.net/npm/[email protected]/dist/main.js
```

##### Country Flag SVG (optional)

```html

```

```html

const mm = window.CountryList.findOneByCountryCode('mm')
document.getElementById('flag').innerHTML = window.CountryFlagSvg[mm.code]

```

## Development

Want to contribute? Great!
Fork the repo and create PR to us.