metascraper-logo-favicon

metascraper logo favicon fallback

Usage no npm install needed!

<script type="module">
  import metascraperLogoFavicon from 'https://cdn.skypack.dev/metascraper-logo-favicon';
</script>

README

metascraper-logo-favicon

npm Dependency Status

metascraper logo favicon fallback.

Install

$ npm install metascraper-logo-favicon --save

API

metascraper-logo-favicon([options])

options

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)
}

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.

License

metascraper-logo-favicon © Microlink, Released under the MIT License.
Authored and maintained by Microlink with help from contributors.

microlink.io · GitHub @microlink.io · Twitter @microlinkhq