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

1.1.2 • Public • Published

⭐ Favorite Icon

NPM version NPM downloads

Small library for manipulating desktop favicon.

Desktop browser support

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

Advantages

  • data: and canvas support
  • GIF, JPEG, PNG, SVG and other browser-supported formats
  • Ultra-small code size

Installation

npm install favorite-icon

Using

import { Favicon } from 'favorite-icon';

Favicon.set('/my-icon.png');

API

Favicon.set(src: string | HTMLCanvasElement)

Set the favicon with your own image.

import { Favicon } 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 { Favicon } from 'favorite-icon';

// ...

Favicon.reset();

MIT License

Packages

Num. Package Demo Version Download
1. Favorite Icon Demo NPM version NPM downloads
2. 📛 Favorite Icon Badge Demo NPM version NPM downloads
3. 😃 Favorite Icon Emoji Demo NPM version NPM downloads
4. ⚠️ Favorite Icon Status Demo NPM version NPM downloads
5. Favorite Icon Video Demo NPM version NPM downloads
6. 🔴 Favorite Icon Dot Demo NPM version NPM downloads
7. ⏱️ Favorite Icon Timeout Worker Demo NPM version NPM downloads

Package Sidebar

Install

npm i favorite-icon

Weekly Downloads

15

Version

1.1.2

License

MIT

Unpacked Size

15.4 kB

Total Files

19

Last publish

Collaborators

  • hcodes