@realfavicongenerator/check-favicon
TypeScript icon, indicating that this package has built-in type declarations

0.4.8 • Public • Published

@realfavicongenerator/check-favicon

A TypeSCript library to check the favicon of a website. This library is used by the favicon checker of RealFaviconGenerator.

The checker analyzes an HTML page to produce a report, platform per platform (desktop, iOS, Web app manifest). The report contains logs, warnings and errors messages, along with the icons themselves.

Install:

npm install @realfavicongenerator/check-favicon node-html-parser

Usage:

import { parse } from 'node-html-parser'
import { checkDesktopFavicon, checkTouchIcon, checkWebAppManifest } from '@realfavicongenerator/check-favicon'

const body = fs.readFileSync('some_page.html');

const root = parse(body);
const head = root.querySelector('head');

const desktopFaviconReport = await checkDesktopFavicon(pageUrl, head);
const touchIconFaviconReport = await checkTouchIcon(pageUrl, head);
const webAppManifestFaviconReport = await checkWebAppManifest(pageUrl, head);

console.log("Analysis and icons", desktopFaviconReport, touchIconFaviconReport, webAppManifestFaviconReport);

Package Sidebar

Install

npm i @realfavicongenerator/check-favicon

Weekly Downloads

339

Version

0.4.8

License

ISC

Unpacked Size

276 kB

Total Files

60

Last publish

Collaborators

  • phbernard