1. metascraper-logo-favicon
metascraper logo favicon fallback
metascraper-logo-favicon
Package: metascraper-logo-favicon
Created by: microlinkhq
Last modified: Thu, 14 Mar 2024 09:21:42 GMT
Version: 5.45.2
License: MIT
Downloads: 58,009
Repository: https://github.com/microlinkhq/metascraper

Install

npm install metascraper-logo-favicon
yarn add metascraper-logo-favicon

metascraper

metascraper-logo-favicon: Metascraper logo favicon fallback.

See our website for more information.


Install

 $ npm install metascraper-logo-favicon --save

API

metascraper-logo-favicon([options])

options

google

Type: boolean

Default: true

It enables logo resolution using Google API.

favicon

Type: boolean

Default: true

It tries to resolve favicon.ico of the url.

rootFavicon

Type: boolean|regexp

Default: true

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

pickFn

Type: function

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

 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.

gotOpts

Type: object

Any option provided here will passed to got#options.

keyvOpts

Type: object

Any option provided here will passed to @keyvhq/memoize#options.

License

metascraper-logo-favicon © Microlink, released under the MIT License.

Authored and maintained by Microlink with help from contributors.

microlink.io · GitHub microlinkhq · Twitter @microlinkhq

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin