web-icon-scraper

0.0.0-development • Public • Published

web-icon-scraper

A Node Package to retrieve an array of favicons and apple-touch-icon images sorting them into ascending or descending size order.

Usage

Example Use:


  const webIconScraper = require('web-icon-scraper');

  webIconScraper({
    url: 'https://github.com',
    sort: 'des',
    limit: 1,
    checkStatus: false,
    followRedirectsCount: 0
  }).then(output => {
    console.log(output);
  });

  // example output:
  [
    {
      type: 'favicon',
      size: 20,
      link: 'https://github.githubassets.com/favicon.ico'
    }
  ]

Options:

url: 'url' as String (required)

sort: 'asc' or 'des' (descending or ascending in icon size)

limit: limit icons as Integer.

checkStatus: When true it checks the status code of each icon, returns all of status code 200.

followRedirectsCount: Limit the number of redirects, defaults to 0.

Test

from the /test directory run, yarn test

Collaboration

Please get in touch to share ideas or collaborate with me on this library.

TODO's

  • Refine the code to improve performance
  • Add Typscript

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.0-development1latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.0-development1
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i web-icon-scraper

Weekly Downloads

1

Version

0.0.0-development

License

MIT

Unpacked Size

20.1 kB

Total Files

9

Last publish

Collaborators

  • nicholastaras