Registry / devops / favicon-fetch

favicon-fetch

JSON →
library1.0.0jsnpmunverified

A lightweight package to quickly retrieve a favicon URL for any website using the Icon Horse service. Current stable version is 1.0.0. It provides a simple function that accepts a hostname or full URI and returns a direct favicon URL. Supports optional size, fallback text/background color, and API key for advanced features. Differentiator: minimal API and zero external dependencies beyond the network service.

npm install favicon-fetch
INSTALL
IMPORT
SIG · FAVICON-FETCH
F
favicon-fetch
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import faviconFetch from 'favicon-fetch'
import { faviconFetch } from 'favicon-fetch'
ESM default import. The package exports a single function as default.
default
const faviconFetch = require('favicon-fetch')
const { faviconFetch } = require('favicon-fetch')
CommonJS require. Destructuring is incorrect because the module exports a function directly, not an object.
faviconFetch (type)
import type { FaviconFetchOptions } from 'favicon-fetch'
import { FaviconFetchOptions } from 'favicon-fetch'
TypeScript users should import the options type with `import type` to avoid runtime side effects.

Shows how to import the function and get a favicon URL for a given hostname.

import faviconFetch from 'favicon-fetch'; const url = faviconFetch({ hostname: 'github.com' }); console.log(url); // Output: 'https://icon.horse/icon/github.com'
Debug
Known issues
gotchaThe function returns a URL string, not the actual icon binary. It does not download or validate the icon.
fix
Understand that the result is a URL; use further HTTP requests to fetch the icon if needed.
affects: >=1.0.0
gotchaRequires an active internet connection to the Icon Horse service; offline usage is not possible.
fix
Ensure network access to icon.horse.
affects: >=1.0.0
gotchaThe `size` and fallback options require an `apikey`. Without it, those options are ignored.
fix
Provide a valid API key from Icon Horse when using size or fallback options.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'favicon-fetch'
Package not installed or import path incorrect.
fix
Run `npm install favicon-fetch` and ensure import is correct.
faviconFetch is not a function
Incorrect import (named import instead of default).
fix
Use `import faviconFetch from 'favicon-fetch'` or `const faviconFetch = require('favicon-fetch')`.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
favicon-fetch — npm install favicon-fetch · libregistry