npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hritikwork.npm/favicon-kit

v0.2.0

Published

Generate favicon assets, head snippets, and runtime favicon injection helpers.

Readme

@hritikwork.npm/favicon-kit

A reusable favicon package for generating favicon assets, creating framework-friendly favicon structure, and safely wiring favicon tags into a project.

What this package does

  • Generates a standard favicon set from one logo or icon image
  • Creates a real favicon.ico
  • Detects html, laravel, and hugo projects
  • Creates proper favicon structure for those projects
  • Produces snippets for html, laravel, and hugo
  • Injects managed favicon blocks into project head files safely

Install

npm install @hritikwork.npm/favicon-kit

Node 18 or newer is required.

Recommended command: init

Use init when a project does not already have favicon structure and you want the package to set it up for you.

Simple HTML

npx favicon-kit init --framework html --input ./logo.png --file ./index.html

Laravel

npx favicon-kit init --framework laravel --input ./public/images/logo.png

Hugo

npx favicon-kit init --framework hugo --input ./static/images/logo.png

What init does:

  • detects the project type if you do not pass --framework
  • finds or uses the input image
  • creates the favicon output folder
  • generates the favicon files
  • writes the correct snippet/partial structure
  • injects a managed include or head block when possible
  • writes .favicon-kit.json

Quick start without init

1. Generate favicon files

npx favicon-kit generate \
  --input ./logo.png \
  --out ./public/images/favicons \
  --base-path /images/favicons

2. Add the favicon tags to your project

For plain HTML:

npx favicon-kit inject \
  --framework html \
  --file ./public/index.html \
  --base-path /images/favicons

For Laravel:

npx favicon-kit snippet \
  --framework laravel \
  --base-path images/favicons \
  --out ./resources/views/partials/favicon.blade.php

For Hugo:

npx favicon-kit snippet \
  --framework hugo \
  --base-path images/favicons \
  --out ./layouts/partials/favicon.html

CLI usage

Initialize a project

npx favicon-kit init --framework laravel --input ./public/images/logo.png

Generate favicon assets

npx favicon-kit generate \
  --input ./logo.png \
  --out ./public/images/favicons \
  --base-path /images/favicons \
  --html favicon-head.html

Write a framework snippet

npx favicon-kit snippet \
  --framework laravel \
  --base-path images/favicons \
  --out ./resources/views/partials/favicon.blade.php

Inject into an existing head file

npx favicon-kit inject \
  --framework html \
  --file ./public/index.html \
  --base-path /images/favicons

Supported frameworks:

  • html
  • laravel
  • hugo

Managed blocks use markers like:

<!-- favicon-kit:start -->
<!-- favicon-kit:end -->

Node API

import { generateFavicons, initFaviconProject, injectFaviconsIntoFile } from "@hritikwork.npm/favicon-kit/node";

await initFaviconProject({
  framework: "html",
  input: "./logo.png",
  file: "./index.html"
});

await generateFavicons({
  input: "./logo.png",
  outputDir: "./public/images/favicons",
  basePath: "/images/favicons"
});

await injectFaviconsIntoFile({
  file: "./public/index.html",
  framework: "html",
  basePath: "/images/favicons"
});

Browser API

Use this when you only want runtime favicon updates in the browser.

import { applyFaviconTags, applySingleFavicon } from "@hritikwork.npm/favicon-kit/browser";

applyFaviconTags({
  basePath: "/images/favicons",
  includeManifest: true
});

applySingleFavicon({
  href: "/brand/favicon.png"
});

Adapter imports

import { buildHtmlSnippet } from "@hritikwork.npm/favicon-kit/adapters/html";
import { buildLaravelBladeSnippet } from "@hritikwork.npm/favicon-kit/adapters/laravel";
import { buildHugoSnippet } from "@hritikwork.npm/favicon-kit/adapters/hugo";

Verification

Check the CLI:

npx favicon-kit help

Verify the published package version:

npm view @hritikwork.npm/favicon-kit version

Testing

npm test