2.0.0-beta.1 • Published 10 months ago

country-flags-svg v2.0.0-beta.1

Weekly downloads
772
License
MIT
Repository
github
Last release
10 months ago

country-flags-svg

A list of countries with url links to a svg image which you can simply use in your web application

NPM

Coveralls npm

Install

$ npm install country-flags-svg

or

$ yarn add country-flags-svg

Usage

import { findFlagUrlByNationality } from "country-flags-svg";

const flagUrl = findFlagUrlByNationality("Australian");
// => "http://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg"
import { countries } from "country-flags-svg";

const australia = countries[0];

console.log(australia);
/* => {
		name: "Australia",
		demonym: "Australian",
		flag: "http://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg",
		iso2: "AU",
		iso3: "AUS",
	}
*/

API

countries

Returns all available information.

findFlagUrlByCountryName(countryName)

Returns SVG link of the official flag for a specified country (according to countryName) or empty string if is not exist

findFlagUrlByNationality(nationality)

Returns SVG link of the official flag for a specified country (according to nationality) or empty string if is not exist

findFlagUrlByIso2Code(iso2Code)

Returns SVG link of the official flag for a specified country (according to ISO 3166-1 alpha-2 code) or empty string if is not exist

findFlagUrlByIso3Code(iso3Code)

Returns SVG link of the official flag for a specified country (according to ISO 3166-1 alpha-3 code) or empty string if is not exist

Available Flags

The full list of available flags you can see on the Docs page

if not enough don't be shy and provide merge request ;)

License

Licensed under MIT.

1.1.9

10 months ago

2.0.0-beta.1

10 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.15

4 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago