Socket
Socket
Sign inDemoInstall

country-flags-svg

Package Overview
Dependencies
0
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    country-flags-svg

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


Version published
Weekly downloads
8K
increased by15.41%
Maintainers
1
Install size
160 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 15 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc