@owlbear-rodeo/page-icon
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

License: MIT Build Status

Page Icon

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 >= 16.

$ npm install --save @owlbear-rodeo/page-icon

Usage

const pageIcon = require('@owlbear-rodeo/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

Readme

Keywords

none

Package Sidebar

Install

npm i @owlbear-rodeo/page-icon

Weekly Downloads

3

Version

0.6.0

License

MIT

Unpacked Size

20.2 kB

Total Files

15

Last publish

Collaborators

  • mitchemmc
  • nthouliss