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

@docyrus/logo-asset-generator

v0.3.2

Published

CLI tool to generate favicon and app icons from a source logo

Readme

@docyrus/logo-asset-generator

Generate favicon and app icons from a PNG/SVG logo, update your index.html with the correct <link>/<meta> tags, and create/update a manifest.json — all in one command.

  • Input: Local file path or URL to a logo (PNG or SVG, ideally 512x512)
  • Output: Common favicon/app icon set (+ favicon.ico) and updated HTML meta tags
  • HTML: Rewrites icon-related tags in your index.html and ensures PWA manifest icons

Features

  • Generates PNG assets:
    • favicon-16x16.png, favicon-32x32.png, favicon-96x96.png
    • android-chrome-192x192.png, android-chrome-512x512.png
    • apple-touch-icon.png and explicit sizes: 60x60, 76x76, 120x120, 152x152, 180x180
    • mstile-150x150.png
    • Social preview: og-image.png (1200x1200)
  • Generates favicon.ico from available favicon sizes (includes 16 and 32 by default)
  • Updates index.html <head> with:
    • <link rel="icon" ...> for .ico and PNG sizes (16, 32, 96)
    • <link rel="apple-touch-icon" ...> variants
    • <link rel="manifest" href="/manifest.json">
    • <meta name="msapplication-TileColor" content="#ffffff">
    • <meta name="msapplication-TileImage" content="/mstile-150x150.png">
    • <meta name="theme-color" content="#ffffff">
    • OpenGraph image tags for og-image.png
  • Creates/updates manifest.json (in same directory as index.html) with Android icon entries

Requirements

  • Node.js 18+ (sharp 0.33+)

Installation

Using pnpm (recommended):

pnpm add -D @docyrus/logo-asset-generator

CLI Usage

logo-asset-generator --logo <path-or-url> --index <path-to-index.html> [--output <output-dir>]
  • --logo, -l (required): Path or URL to PNG/SVG logo (ideally 512x512)
  • --index, -i (required): Path to index.html to update
  • --output, -o (optional): Output directory for generated assets
    • Defaults to the directory of index.html

Examples:

  • Minimal:
    logo-asset-generator -l ./public/logo.svg -i ./public/index.html
  • Custom output directory:
    logo-asset-generator -l https://example.com/logo.png -i ./apps/web/public/index.html -o ./apps/web/public

Monorepo execution (from repo root) with pnpm workspace filter:

pnpm -w --filter @docyrus/logo-asset-generator exec logo-asset-generator \
  -l ./apps/test/public/logo.svg \
  -i ./apps/test/public/index.html \
  -o ./apps/test/public

What gets generated

In the output directory (--output or the directory of index.html):

  • PNG icons listed in Features
  • favicon.ico (ico contains 16x16 and 32x32 PNGs by default)
  • Updated index.html (icon/meta tags replaced under <head>)
  • manifest.json created/updated with Android icon entries

Note: Existing icon-related <link> tags and og:image meta tags in index.html will be removed and regenerated.

Programmatic API

ESM import (Node 18+):

import { generateAssets, updateHtmlMetaTags, loadImage, downloadImage } from '@docyrus/logo-asset-generator'

await generateAssets({
  logoPath: './public/logo.svg',
  htmlPath: './public/index.html',
  // outputDir: './public', // optional, defaults to dirname(htmlPath)
  // sizes: [ { name: 'favicon-16x16.png', size: 16 }, ... ] // optional
})

Types:

interface AssetSize {
  name: string
  size: number
  purpose?: string // e.g. 'og' for social preview image
}

interface GeneratorOptions {
  logoPath: string
  htmlPath: string
  outputDir?: string
  sizes?: AssetSize[]
}

Customize sizes (advanced):

import { generateAssets } from '@docyrus/logo-asset-generator'

await generateAssets({
  logoPath: './logo.png',
  htmlPath: './index.html',
  sizes: [
    { name: 'favicon-16x16.png', size: 16 },
    { name: 'favicon-32x32.png', size: 32 },
    { name: 'android-chrome-192x192.png', size: 192 },
    { name: 'android-chrome-512x512.png', size: 512 },
    { name: 'og-image.png', size: 1200, purpose: 'og' },
  ],
})

Notes

  • Input SVGs are rasterized to PNG at the target sizes via sharp.
  • The tool writes to disk and mutates index.html; commit changes as needed.
  • manifest.json is created if missing; otherwise only its icons array is overwritten.
  • Default theme and tile color are set to #ffffff.

License

MIT © Docyrus, Inc.