Favicon generator for Node CLI
Automate favicon generation in build scripts and npm package workflows.
Node CLI & npm scripts
Generate your favicon package first, then follow the steps below to integrate with Node CLI.
Installation steps
- 1
Generate favicons locally with our browser tool and save the ZIP.
- 2
Add an npm script to copy favicons into your project's public/ or dist/ folder.
- 3
Run the copy step before build or as part of your prepublish script.
- 4
Commit generated assets or regenerate them in CI for reproducible builds.
- 5
Document the script in your README for team members.
Code & configuration
Copy and adapt for your Node CLI project
// package.json
{
"scripts": {
"favicons:copy": "cpy 'favicon-package/**' public --flat",
"prebuild": "npm run favicons:copy"
}
}
// Or with a small Node script:
const fs = require("fs");
const path = require("path");
const src = path.join(__dirname, "favicon-package");
const dest = path.join(__dirname, "public");
for (const file of fs.readdirSync(src)) {
fs.copyFileSync(path.join(src, file), path.join(dest, file));
}Pro tips
- Pair with chokidar-cli to watch and sync favicon changes during development.
- Use npx only for one-off copies — checked-in assets are faster in CI.
Files to deploy
favicon.icofavicon.svgfavicon-96x96.pngapple-touch-icon.pngandroid-chrome-192x192.pngandroid-chrome-512x512.pngsite.webmanifest