New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

favicon-fetch

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

favicon-fetch

Get any website's favicon

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
decreased by-2.4%
Maintainers
1
Weekly downloads
 
Created
Source

favicon-fetch

This package quickly gives you a URL for any website's favicon.

Uses the Icon Horse service to fetch the icon.

Installing

npm install favicon-fetch

or:

yarn add favicon-fetch

Basic usage

// First, import the package:
const faviconFetch = require('favicon-fetch')
// or:
import faviconFetch from 'favicon-fetch'

faviconFetch({ hostname: 'wikipedia.org' })
//-> The URI for an icon: https://icon.horse/icon/wikipedia.org

// Alternatively, use any URI:
faviconFetch({ uri: 'https://en.wikipedia.org/wiki/1986' })
//-> The URI for an icon: https://icon.horse/icon/wikipedia.org

The icon returned looks like this:

Wikipedia icon

Additional options

Currently, both the fallback functionality and the size param require an apikey (read about getting one here).

faviconFetch({
  // hostname or uri

  // This will return a different sized icon if available
  size: 'small|medium|big',

  // If no icon is reachable, a fallback image is shown. These two options control the colour
  fallbackText: 'FFFFFF',
  fallbackBg: '000000',

  // If you have an Icon Horse API key
  apikey: ''
})

Keywords

FAQs

Package last updated on 03 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc