A module for grabbing Favicon for any web site
$ npm install favicongrab --save
or
yarn add favicongrab
const { grabFavicon } = require('favicongrab');
grabFavicon('https://about.theanubhav.com').then((response)=>{console.log(response)})
Above call returns following response
{ domain: 'about.theanubhav.com',
icons: [ {
src: 'https://about.theanubhav.com/favicon.ico',
type: 'image/x-icon'
} ]
}
-
returns - Promise
-
arguments - siteUrl // e.g theanubhav.com
-
Result Data
-
Success :
{ domain: 'about.theanubhav.com', icons: [ { src: 'https://about.theanubhav.com/favicon.ico', type: 'image/x-icon' } ] }
Description properties of icon object:
- property src contains an absolute URL for a favicon image and is required and unique;
- property type equals an MIME-type's favicon image;
- property sizes contains size's favicon image and in a simple case has the following format: HEIGHTxWIDTH in pixels.
- Failure :
All error messages have the following format
{
"error": "Unresolved domain name."
}
favicongrab
uses HTTP API from favicongrabber. Refer service API reference here.
- favicon-downloader A module for download Favicon of any web site.
Currently, favicongrab
is supported for Nodejs Environment only. Please open a issue for browser support, if required.
- favicon-downloader A module for downloading Favicon of any web site.
- favicon-downloader-cli CLI for favicon-downloader module
Suggestions and PRs are welcome!
Please create issue or open PR request for contribution.
refer LICENSE
file in this repository.