npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

flagmask

v1.0.8

Published

A CSS utility library to mask text and elements with country flags using CSS class.

Downloads

279

Readme

🏁 FlagMask

A lightweight CSS utility library that allows you to mask text and elements with country flags using simple CSS classes. Transform any text into beautiful flag patterns using SVG masks and background images.

✨ Features

  • 🌍 240+ Country Flags: Comprehensive collection including countries, territories, and regions
  • 🎨 Text Masking: Apply flag patterns to any text content
  • 📱 Responsive: Works seamlessly across all device sizes
  • 🚀 Zero Dependencies: Pure CSS implementation, no JavaScript required
  • 🎯 Easy to Use: Simple class-based API
  • 🔧 Customizable: Override styles to fit your design needs
  • Lightweight: Minimal file size with optimized SVG flags

🚀 Quick Start

Installation

📦 Via CDN

Add this line to your HTML <head> section:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flagmask@latest/flagmask.css">

📋 Via npm

Install the package:

npm install flagmask

Import in your JavaScript/TypeScript:

// Automatic CSS import (recommended)
import 'flagmask';

// Or explicit CSS import
import 'flagmask/flagmask.css';

Note: The automatic CSS import works with modern bundlers like Webpack, Vite, Rollup, etc. that support CSS imports in JavaScript modules.

Basic Usage

Simply add the appropriate flag class to any HTML element:

<!-- Basic text masking -->
<span class="flag-us">United States</span>
<span class="flag-gb">United Kingdom</span>
<span class="flag-fr">France</span>
<span class="flag-de">Germany</span>

<!-- Works with any text element -->
<h1 class="flag-ca">Canada</h1>
<p class="flag-jp">Japan</p>
<div class="flag-br">Brazil</div>

🎨 Examples

Text Masking

<h2 class="flag-us">AMERICA</h2>
<h2 class="flag-gb">BRITAIN</h2>
<h2 class="flag-fr">FRANCE</h2>

Custom Styling

.my-flag-text {
  font-size: 4rem;
  font-weight: bold;
  text-transform: uppercase;
}
<div class="flag-de my-flag-text">Deutschland</div>

🗺️ Available Flags

FlagMask includes flags for:

Countries (ISO 3166-1 alpha-2)

  • Americas: us, ca, br, mx, ar, cl, pe, co, ve, etc.
  • Europe: gb, fr, de, it, es, nl, se, no, fi, pl, etc.
  • Asia: cn, jp, in, kr, th, sg, my, ph, id, vn, etc.
  • Africa: za, ng, eg, ma, ke, gh, tz, ug, dz, etc.
  • Oceania: au, nz, fj, pg, sb, vu, to, ws, etc.

Special Territories & Regions

  • UK Subdivisions: gb-eng (England), gb-sct (Scotland), gb-wls (Wales), gb-nir (Northern Ireland)
  • Spanish Regions: es-ct (Catalonia), es-ga (Galicia), es-pv (Basque Country)
  • Saint Helena: sh-ac (Ascension), sh-hl (Saint Helena), sh-ta (Tristan da Cunha)

International Organizations

  • eu - European Union
  • un - United Nations
  • arab - Arab League
  • asean - ASEAN
  • eac - East African Community
  • cefta - Central European Free Trade Agreement

🔧 Browser Support

FlagMask works in all modern browsers that support:

  • CSS mask property
  • CSS background-clip: text
  • SVG images

| Browser | Version | |---------|---------| | Chrome | 120+ | | Firefox | 53+ | | Safari | 15.4+ | | Edge | 79+ |

📋 Complete Flag List

A

ad, ae, af, ag, ai, al, am, ao, aq, ar, arab, as, asean, at, au, aw, ax, az

B

ba, bb, bd, be, bf, bg, bh, bi, bj, bl, bm, bn, bo, bq, br, bs, bt, bv, bw, by, bz

C

ca, cc, cd, cefta, cf, cg, ch, ci, ck, cl, cm, cn, co, cp, cr, cu, cv, cw, cx, cy, cz

D-E

de, dg, dj, dk, dm, do, dz, eac, ec, ee, eg, eh, er, es, es-ct, es-ga, es-pv, et, eu

F-G

fi, fj, fk, fm, fo, fr, ga, gb, gb-eng, gb-nir, gb-sct, gb-wls, gd, ge, gf, gg, gh, gi, gl, gm, gn, gp, gq, gr, gs, gt, gu, gw, gy

H-L

hk, hm, hn, hr, ht, hu, ic, id, ie, il, im, in, io, iq, ir, is, it, je, jm, jo, jp, ke, kg, kh, ki, km, kn, kp, kr, kw, ky, kz, la, lb, lc, li, lk, lr, ls, lt, lu, lv, ly

M-P

ma, mc, md, me, mf, mg, mh, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, na, nc, ne, nf, ng, ni, nl, no, np, nr, nu, nz, om, pa, pc, pe, pf, pg, ph, pk, pl, pm, pn, pr, ps, pt, pw, py

Q-Z

qa, re, ro, rs, ru, rw, sa, sb, sc, sd, se, sg, sh, sh-ac, sh-hl, sh-ta, si, sj, sk, sl, sm, sn, so, sr, ss, st, sv, sx, sy, sz, tc, td, tf, tg, th, tj, tk, tl, tm, tn, to, tr, tt, tv, tw, tz, ua, ug, um, un, us, uy, uz, va, vc, ve, vg, vi, vn, vu, wf, ws, xk, xx, ye, yt, za, zm, zw

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository
  2. Make your changes
  3. Test with various browsers
  4. Submit a pull request

📞 Support

If you encounter any issues or have questions:

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by ToJaCytryn

🤖 Readme generated with GitHub Copilot