Socket
Socket
Sign inDemoInstall

free-flag-icons

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    free-flag-icons

Icons from freeflagicons.com


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Install size
5.44 MB
Created
Weekly downloads
 

Readme

Source

Free Flag Icons

This package is simply a scraper for freeflagicons.com. As of right now, it only contains the Flag Background style but it would be trivial to add others (just submit an issue).

These images are free for personal usage, but you must pay for a commercial license. See the site and their license for more details.

Usage

Start by installing the package...

npm install free-flag-icons

Then include them through the path to the given style (e.g. free-flag-icons/[style]/us.jpg). For example, if you're using a bundler like parcel or webpack that supports import-ing images:

import USFlag from 'free-flag-icons/flag_background/us.jpg'

The ISO two-letter country codes are used for each country which makes the images really easy to consume programmatically. For example in parcel, you can...

import flagImages from 'free-flag-icons/flag_background/*.jpg'

// Use some `countryCode` variable to automatically pluck the right image
flagImages[countryCode]

Contributing

Contributions are welcome, just create an issue or pull request. My goal is to keep this package extremely simple. The most common change is likely just to add a new flag style.

Keywords

FAQs

Last updated on 29 Oct 2021

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