0.0.2 โ€ข Published 1 year ago

faviconic v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Favicon gets icons for any domain name.

Getting Started

To start using Faviconic install it using npm or yarn.

yarn add faviconic

or

npm install faviconic --save

How to use Faviconic

Faviconic is very simple to use. Just import the getIcon function and you are good to go.

import { getIcon } from "faviconic"

const { url } = getIcon("yahoo.com"); // just the domain

const { url } = getIcon("https://yahoo.com") // with the protocol

const { url, size } = getIcon("yahoo.com") // with icon size

// size: { width: 512, height: 512 }

Configuration

When using getIcon the following options are available:

  • targetSize: If multiple icons are found, the icon closest to this size will be selected. Defaults to 512, value is in pixels.

Here is an example with the default value for each option:

const { url } = getIcon("yahoo.com", {
  targetSize: 512
})

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Joshua Snyder - @joshsny - LinkedIn