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

    0.3.0 • Public • Published

    ⭐ Favorite Icon

    NPM version NPM downloads Bundlephobia

    A small library for manipulating the favicon.

    Installation

    npm install favorite-icon

    Using

    import FaviconIcon from 'favorite-icon';
     
    FaviconIcon.set('/my-icon.png');

    API

    Favicon.set(src: string | HTMLCanvasElement)

    Set the favicon with your own image.

    import FaviconIcon from 'favorite-icon';
     
    Favicon.set('./image.png');
     
    // or
     
    Favicon.set('data:image/png;base64,...');
     
    // or
     
    const canvas = document.createElement('canvas');
    //...
    Favicon.set(canvas);

    Favicon.reset()

    Reset the favicon.

    import FaviconIcon from 'favorite-icon';
     
    // ...
     
    Favicon.reset();

    Browser support

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

    License

    MIT License

    Install

    npm i favorite-icon

    DownloadsWeekly Downloads

    1

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    10.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • hcodes