Skip to content

mattruzzi/page-icon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Page Icon

Build Status

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

This a Javascript implementation of http://stackoverflow.com/a/22007642/5076225.

Installation

Requires Node.js >= 10.

$ npm install --save page-icon

Usage

const pageIcon = require('page-icon');

const URL = 'https://www.facebook.com/';
pageIcon(siteUrl)
    .then(function(icon) {
        // do things with icon object
        console.log(icon);
    })
    .catch(error => {
        console.error(error);
    });
});

Example Icon Object

{ 
    source: 'https://www.facebook.com/apple-touch-icon.png',
    name: 'www.facebook.com',
    data: <Buffer 89 50 4e ... >,
    size: 1779,
    ext: '.png',
    mime: 'image/png' 
}

Tests

$ npm test

License

MIT

About

Find the best icon for a web page

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%