Neurophysiologically Pseudoscientific Manatee

    favorite-icon-badge
    TypeScript icon, indicating that this package has built-in type declarations

    0.4.1 • Public • Published

    📛 Favorite Icon Badge

    NPM version NPM downloads Bundlephobia

    A small library for badge manipulating in favicon.

    Installation

    npm install favorite-icon-badge

    Demo

    Using

    import FaviconBadge from 'favorite-icon-badge';
     
    const badge = new FaviconBadge();
     
    badge.set(count);

    Advanced settings

    import FaviconBadge from 'favorite-icon-badge';
     
    const badge = new FaviconBadge({
        backgroundColor: '#ff0000',
        fontFamily: 'arial, sans-serif',
        fontStyle: 'normal',
        strokeColor: '#000',
        textColor: '#fff',
        faviconSrc: '/my-icon.png',
        maxCount: 99,
        size: Favicon.size,
        links: Favicon.icons,
        positionX: 'right',
        positionY: 'bottom'
    });
     
    badge.set(count);

    API

    .set(count: number)

    Set the favicon with the badge.

    import FaviconBadge from 'favorite-icon-badge';
     
    const badge = new FaviconBadge();
     
    badge.set(count);

    .reset()

    Reset the favicon.

    import FaviconBadge from 'favorite-icon-badge';
     
    const badge = new FaviconBadge();
     
    // ...
     
    badge.reset();

    Browser support

    • Chrome: ✅
    • Firefox: ✅
    • Opera: ✅
    • IE: ❌
    • Edge: ❌
    • Safari: ❌ (Safari hides favicons)

    License

    MIT License

    Install

    npm i favorite-icon-badge

    DownloadsWeekly Downloads

    1

    Version

    0.4.1

    License

    MIT

    Unpacked Size

    29.9 kB

    Total Files

    8

    Last publish

    Collaborators

    • hcodes