faviconic

0.0.2Β β€’Β PublicΒ β€’Β Published

Logo

Faviconic

Get any logo from a domain.


Get Started Β· Report Bug

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

Package Sidebar

Install

npm i faviconic

Weekly Downloads

5

Version

0.0.2

License

MIT

Unpacked Size

8.97 kB

Total Files

4

Last publish

Collaborators

  • joshuasnyder