← 全部工具

andmitr/favicon-generator-cli

热度 75 更新于 开发与构建

A Node.js CLI tool that generates a full set of favicons from PNG and SVG source images. Outputs optimized icons in multiple sizes and formats (ICO, Apple Touch Icon, Android Chrome, etc.) ready for cross-browser use.

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

Favicon Generator CLI

A Node.js CLI tool that generates a full set of favicons from PNG and SVG source images. Outputs optimized icons in multiple sizes and formats (ICO, Apple Touch Icon, Android Chrome, etc.) ready for cross-browser use.

Table of Contents

  • Features
  • Dependencies
  • Installation
  • Usage
  • License

Features

  • Generated files:
  • favicon.ico (multi-size: 16px, 32px, 48px, 256px from PNG)
  • favicon.svg (optimized from source SVG)
  • favicon-16x16.png
  • favicon-32x32.png
  • favicon-48x48.png
  • apple-touch-icon.png (180×180px)
  • icon-192.png and icon-512.png (for Android/PWA manifest)
  • PNG and SVG input: Accepts both formats as source material. Defaults

to ./faviconsrc.png and ./faviconsrc.svg.

  • Image optimization: Uses sharp for PNG resizing,

imagemin + imagemin-pngquant for PNG compression, svgo for SVG optimization, and png2icons for ICO generation.

  • Custom output directory: Specify an output path with --dist, or let

the tool create a faviconsxxxx directory in the current working directory.

  • CLI arguments: Simple command-line interface with --help for usage

details.

  • Error handling: Reports missing source files and image processing

failures.

Note: This tool does not generate a 512×512 maskable icon for PWA safe-zone compliance. This must be created separately using a tool like maskable.app. Make sure your PWA manifest references the maskable icon alongside other icons.

Dependencies