RealFaviconGenerator CLI
raw JSON →cli-real-favicon is a Node.js command-line interface (CLI) tool designed to automate the process of generating multi-platform favicons using the RealFaviconGenerator web service. It allows developers to generate comprehensive icon sets (including web app manifests, iOS, Android, and Windows tile icons) based on a single source image and a detailed configuration file. The current stable version, 0.0.9, was released several years ago and the project appears to be unmaintained. This means it may not support the latest icon formats, browser requirements, or security best practices, and relies on an older version of the RealFaviconGenerator API. Its primary utility lies in programmatically generating favicon assets, but its age necessitates careful consideration for new projects. The tool's distinct feature is its ability to take a configuration exported from the RealFaviconGenerator website and apply it locally through a CLI.
Common errors
error Error: Command failed with exit code 1 ↓
favicon-config.json for any errors. error cli-real-favicon: command not found ↓
npm install -g cli-real-favicon. If installed locally in a project, execute it using npx cli-real-favicon or by referencing the binary directly: node_modules/.bin/cli-real-favicon. error Error: ENONT: no such file or directory, open 'favicon-config.json' ↓
favicon-config.json file is present in the directory from which you are running the command, or provide the correct relative or absolute path to its location. Warnings
breaking The package (v0.0.9) has not been updated since 2017. It may rely on outdated dependencies with known security vulnerabilities (CVEs) and might not function correctly with modern Node.js versions (e.g., Node.js 16+ or ESM-only environments) or current RealFaviconGenerator API changes. ↓
gotcha The CLI's core functionality is entirely dependent on the external RealFaviconGenerator.net API. Any breaking changes, deprecations, or outages on the web service's side will directly impact the CLI's ability to generate favicons, without any possibility of a fix from this unmaintained package. ↓
gotcha The configuration JSON, source image path, and output destination path are critical. Incorrect paths or an invalid configuration JSON (e.g., missing required fields) will lead to generation failures without clear error messages from the CLI. ↓
Install
npm install cli-real-favicon yarn add cli-real-favicon pnpm add cli-real-favicon Quickstart
// 1. Create a source image, e.g., `src/logo.png` (min. 260x260px).
// 2. Go to RealFaviconGenerator.net, upload your image, and customize your favicons.
// 3. On the result page, navigate to the 'Node CLI' tab and copy the generated configuration JSON.
// Save this JSON to a file in your project, e.g., `favicon-config.json`.
// (Example content below, your actual content will vary based on your choices):
{
"design": {
"ios": {
"pictureAspect": "backgroundAndMargin",
"backgroundColor": "#ffffff",
"margin": "14%"
},
"androidChrome": {
"pictureAspect": "noBackground",
"themeColor": "#ffffff"
},
"safariPinnedTab": {
"pictureAspect": "silhouette",
"themeColor": "#5bbad5"
},
"windows": {
"pictureAspect": "noBackground",
"backgroundColor": "#da532c"
}
},
"settings": {
"compression": "false",
"scalingAlgorithm": "Lanczos",
"errorOnImageTooSmall": false,
"readmeFile": false,
"htmlCodeFile": false,
"previewFile": false,
"markupFile": false,
"versioning": "false",
"manifest": {
"name": "My Awesome App",
"display": "standalone",
"orientation": "any",
"startUrl": "/",
"backgroundColor": "#ffffff",
"themeColor": "#ffffff"
}
},
"version": "0.16"
}
// 4. Install the CLI tool globally:
npm install -g cli-real-favicon
// 5. Run the favicon generation command.
// The paths for config, source image, and output directory are crucial.
mkdir -p public/favicons
cli-real-favicon generate favicon-config.json src/logo.png public/favicons
console.log('Favicons generated in public/favicons!');
// You will then integrate the generated HTML markup into your project's <head>.