A library to find the highest resolution website logo for a given url.
This a TypeScript implementation of the original page-icon library.
yarn global add page-icon-finder
or
yarn add page-icon-finder
USAGE
$ page-icon-finder <URL> [EXTENSION]
ARGUMENTS
URL URL to search the icon in
EXTENSION (.jpg|.png|.ico) Filetype to search for
OPTIONS
-b, --buffer Only output the whole Buffer of the icon
EXAMPLES
$ pageicon <url> [extension]
$ pageicon https://www.wikipedia.com
$ pageicon https://www.wikipedia.com .png
import pageIcon from 'page-icon';
const URL = 'https://www.facebook.com/';
try {
const icon = await pageIcon(URL);
console.log('ICON: ', icon);
} catch (err) {
console.error(err);
}
Optionally the function takes one of the following extensions .jpg
, .png
or .ico
.
{
source: 'https://www.facebook.com/images/fb_icon_325x325.png',
name: 'www.facebook.com',
data: <Buffer 89 50 4e ... >,
size: 1919,
ext: '.png',
mime: 'image/png'
}
Original author: Goh Jia Hao
Forked from https://github.com/jiahaog/page-icon