mkfav
v0.1.0
Published
CLI tool to convert Lucide icons into favicons
Readme
mkfav
Convert any Lucide icon into a favicon. Fast, simple, no dependencies to manage.
Generate favicons from Lucide's 5000+ icon library with a single command.
Installation
npm install -g mkfavOr use directly with npx:
npx mkfav --icon heartUsage
Basic
Generate a favicon from any Lucide icon:
mkfav --icon heartThis creates icon.ico in your current directory.
Custom filename
Specify your own output filename:
mkfav --icon folder-git-2 --output faviconThe .ico extension is added automatically if not provided.
Full example
mkfav --icon rocket --output my-site-favicon.icoOptions
| Flag | Alias | Description | Required |
|------|-------|-------------|----------|
| --icon | -i | Lucide icon name (kebab-case) | Yes |
| --output | -o | Output filename (without or with .ico) | No |
| --version | -v | Show version number | No |
| --help | -h | Show help | No |
Icon Names
Use the kebab-case version of any icon from lucide.dev:
arrow-right→ ArrowRightfolder-git-2→ FolderGit2zap→ Zap
How It Works
- Parses icon name - Converts kebab-case to PascalCase for Lucide lookup
- Generates SVG - Constructs complete SVG from Lucide's icon data
- Converts to PNG - Uses Sharp to render SVG at 32x32
- Creates ICO - Converts PNG to proper ICO format
All in milliseconds.
Use Cases
- Quickly prototype favicon ideas
- Generate favicons for side projects
- Try different icons without design tools
- Automate favicon generation in build scripts
Requirements
- Node.js >= 18
Contributing
Issues and PRs welcome on GitHub.
License
MIT © Shobhit Nagpal
