🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

posthtml-favicons

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-favicons

PostHTML Favicon generator

1.4.0
latest
Source
npm
Version published
Weekly downloads
222
5.21%
Maintainers
1
Weekly downloads
 
Created
Source

PostHTML Favicon Generator Plugin

Build Status

This module is using favicons to generate all of favicons based on a single image

Usage

Use a simple <link> tag to include your favicon. This plugin will add other related tags and writes generated images to disk.

<html>
    <head>
        <link rel="icon" href="path/to/icon.png" />
    </head>
    <body></body>
</html>

Options

See the Options interface in src/index.ts

For favicon configurations see favicon repo:

https://github.com/evilebottnawi/favicons#nodejs

Example

const favIconPlugin = require("posthtml-favicons");
const html = `
<!doctype html>
<html>
    <head>
        <link rel="icon" href="my-icon.png" />
    </head>
    <body>
    </body>
</html>`;

posthtml()
    .use(favIconPlugin({ outDir: "./dist", configuration: { path: "/icons" } }))
    .process(html)
    .then((res) => {
        // files are written to dist folder
        // res.html has new tags
    });

Using with Parcel Bundler

There is an example repo for demonstrating usage with Parcel Bundler

posthtml-favicon-parcel-example

FAQs

Package last updated on 26 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts