# metascraper-logo-favicon

> Metascraper logo fallback that picks favicons and apple-touch icons from HTML.

Latest version **5.58.1** (published 2026-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install metascraper-logo-favicon
pnpm add metascraper-logo-favicon
yarn add metascraper-logo-favicon
bun add metascraper-logo-favicon
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.58.1 |
| Published | 2026-09-17 |
| First published | 2017-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 22 |
| Dependencies | 4 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2738 |
| Author | microlink.io |
| Maintainers | kikobeats |
| Keywords | apple-touch-icon, brand, extract, favicon, html, icon, logo, metadata, metascraper, scraper |

## Links

- npm: https://www.npmjs.com/package/metascraper-logo-favicon
- Repository: https://github.com/microlinkhq/metascraper
- Homepage: https://github.com/microlinkhq/metascraper/packages/metascraper-logo-favicon
- Issues: https://github.com/microlinkhq/metascraper/issues
- npm.io page: https://npm.io/package/metascraper-logo-favicon

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ~4.18.1
- [reachable-url](https://npm.io/package/reachable-url.md) ~2.1.4
- [@keyvhq/memoize](https://npm.io/package/@keyvhq/memoize.md) ~2.2.4
- [@metascraper/helpers](https://npm.io/package/@metascraper/helpers.md) 5.56.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 5.58.1 (latest) — 2026-09-17
- 5.56.2 — 2026-08-17
- 5.55.2 — 2026-08-13
- 5.55.1 — 2026-08-10
- 5.55.0 — 2026-08-09
- 5.54.1 — 2026-08-07
- 5.54.0 — 2026-08-07
- 5.53.1 — 2026-08-02
- 5.53.0 — 2026-07-30
- 5.52.0 — 2026-07-29
- 5.51.1 — 2026-06-19
- 5.50.6 — 2026-06-09
- 5.50.5 — 2026-06-09
- 5.50.3 — 2026-05-11
- 5.50.1 — 2026-04-14
- … 295 more at https://npm.io/package/metascraper-logo-favicon/versions

## README

<div align="center">
  <br>
  <img style="width: 500px; margin:3rem 0 1.5rem;" src="https://metascraper.js.org/static/logo-banner.png" alt="metascraper">
  <br>
  <br>
  <p align="center"><strong>metascraper-logo-favicon</strong>: Metascraper logo favicon fallback.</p>
  <p align="center">See our <a href="https://metascraper.js.org" target='_blank' rel='noopener noreferrer'>website</a> for more information.</p>
  <br>
</div>

## Install

```bash
$ npm install metascraper-logo-favicon --save
```

## API

### metascraper-logo-favicon([options])

#### options

##### favicon

Type: `boolean`<br>
Default: `true`

It tries to resolve `favicon.ico` of the url.

##### google

Type: `boolean`<br>
Default: `true`

It enables logo resolution using Google API.

##### gotOpts

Type: `object`

Any option provided here will passed to [got#options](https://github.com/sindresorhus/got#options).

##### keyvOpts

Type: `object`

Any option provided here will passed to [@keyvhq/memoize#options](https://github.com/microlinkhq/keyv/tree/master/packages/memoize#keyvoptions).

##### pickFn

Type: `function`

It will be used for picking the value to extract from a set of favicon detected on the markup.

```js
const pickFn = (sizes, { pickDefault }) => {
  const appleTouchIcon = sizes.find((item) => item.rel.includes('apple'))
  return (appleTouchIcon || pickDefault(sizes)).url
}

const metascraper = require('metascraper')([
  require('metascraper-logo-favicon')({
    pickFn
  })
])
```

If you don't specific it, the favicon with the bigger size will be picked.

##### resolveFaviconUrl

Type: `function`

It will be used to determine if a favicon URL is valid.

##### rootFavicon

Type: `boolean`|`regexp`<br>
Default: `true`

It tries to resolve `favicon.ico` of the url when the URL is a subdomain.

## License

**metascraper-logo-favicon** © [Microlink](https://microlink.io), released under the [MIT](https://github.com/microlinkhq/metascraper/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/metascraper/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)

---
_Source: https://npm.io/package/metascraper-logo-favicon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
