Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
/ page-icon-finder Public archive

Find the best icon for a web page

License

Notifications You must be signed in to change notification settings

UweStolz/page-icon-finder

Repository files navigation

Actions Status codecov

Page Icon

A library to find the highest resolution website logo for a given url.

This a TypeScript implementation of the original page-icon library.

Installation

yarn global add page-icon-finder
or
yarn add page-icon-finder

Usage

CLI

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

Programmatic

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

Option

Optionally the function takes one of the following extensions .jpg, .png or .ico.

Example Icon Object

{ 
    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' 
}

License

Original author: Goh Jia Hao
Forked from https://github.com/jiahaog/page-icon

MIT

About

Find the best icon for a web page

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published