favicon-so
v0.1.0
Published
CLI for favicon.so — fetch favicons and convert images to favicon packages
Readme
favicon-so
CLI for favicon.so — fetch any website's favicon or convert an image into a complete favicon package.
Install
npm install -g favicon-so
# or
pnpm add -g favicon-soCommands
fetch — Download a website's favicon
favicon-so fetch <domain> [options]| Option | Description |
|--------|-------------|
| -o, --output <path> | Output file path (default: ./<domain>-favicon.<ext>) |
| --info | Print JSON metadata instead of saving image |
| --base-url <url> | Override API base URL (default: https://favicon.so) |
Examples:
# Save github.com favicon
favicon-so fetch github.com
# Custom output path
favicon-so fetch github.com -o ./assets/github.png
# Print metadata (URL, format, isDefault)
favicon-so fetch github.com --info--info output:
{
"url": "https://github.githubassets.com/favicons/favicon.svg",
"format": "image/svg+xml",
"isDefault": false
}convert — Convert image to favicon package
favicon-so convert <image> [options]| Option | Description |
|--------|-------------|
| -o, --output <dir> | Extract files to directory (default: ./favicon-package/) |
| --zip <path> | Save as ZIP instead of extracting |
| --base-url <url> | Override API base URL (default: https://favicon.so) |
Supported formats: PNG, JPG, WebP, GIF, BMP, TIFF, SVG
Examples:
# Extract favicon package to ./favicon-package/
favicon-so convert logo.png
# Extract to custom directory
favicon-so convert logo.png -o ./public/
# Save as ZIP
favicon-so convert logo.png --zip ./favicon.zipOutput files:
favicon.ico (multi-res: 16, 32, 48, 64, 128px)
favicon-16x16.png
favicon-32x32.png
favicon-48x48.png
favicon-64x64.png
favicon-128x128.png
apple-touch-icon.png (180×180)
android-chrome-192x192.png
android-chrome-512x512.png
site.webmanifestSelf-hosting
Point --base-url at your own instance:
favicon-so fetch github.com --base-url http://localhost:3000
favicon-so convert logo.png --base-url https://my-instance.example.comDevelopment
cd cli
pnpm install
pnpm dev fetch github.com --info
pnpm build