@namchee/favify
v0.2.0
Published
Easily fetch all favicons from a webpage
Readme
Favify
Simple library to fetch all favicons from a webpage.
While this library is usable in the browser environment, the library won't bypass the CORS policy.
Features
- 💡 Very simple API
- ✨ Supports modern favicon features
- 🗺️ Works both in browser and Node
- 🌐 Parses with Web Manifests
- 🛂 Written in TypeScript
- 📦 Very compact, 1kB-ish gzipped
Installation
You can install favify with any NodeJS package managers. Below is the example of installing favify with npm
npm install @namchee/favifyNote: favify is an old-and-unmaintained version of the library. For the latest version, always use
@namchee/favify
API
fetchFavicons
Fetches all favicons from the provided url.
Parameters
url (required)
Web page source for searching favicons
config
List of request headers to be used when fetching contents. Useful if the target web page has crawler protection.
config['User-Agent']
Value of User-Agent header to be used when fetching data.
For example, to mimic normal browser behavior, you can use your browser User-Agent value
config['Referrer']
Value of Referrer header to be used when fetching data.
For example, https://www.google.com is a good start, since it basically transform your request as it has been searched via Google.
License
This project is licensed under the MIT license
