A very simple utility to generate various sizes and formats of favicons from a single SVG source file. I use this to generate favicons for my projects. It follows the recommendations from the article on evilmartians.com.
npm install
Replace favicon.svg with your own SVG file.
You can also configure your settings in settings.js
:
// settings.js
export const pathToSvgLogo = "./favicon.svg";
export const outputDir = "./favicons";
Then run the script:
node index.js
# or:
npm run build
The script will generate the following favicon files in the specified output directory:
- SVG favicon
- PNG icons (192x192, 512x512)
- Apple touch icon (180x180)
- Maskable icon (512x512 with padding)
- ICO file (32x32)