favico
v1.2.2
Published
Small favicon downloader
Downloads
3
Readme
favico - Node.js API
Small favicon generator.
Features
- Provides Node.js API and CLI for RealFaviconGenerator
- Provides caching.
Examples
Sample usage via Node.js API
const favico = require("favico");
favico(config)
.then(() => console.log("Favicons are generated"));
Sample usage via CLI
favico -h
favico --config ./favicons.json
Configuration
Configuration file consists mostly of properties from RealFaviconGenerator non-interactive api. Favico use provides some useful defaults and have few additional fields:
output
[required, String] - Path to output directory.reuseOutput
[optional, Boolean] - Do not download favicons if output directory is up to date.cache
[optional, String] - Path to cache directory. If is not set or set to false cache is disabled. Default value:false
.log
[optional, Function/Boolean] - Function to be used for logging. It it is true thenconsole.log
is used. Default value:false
.
Sample config:
{
"output": "./build/favicons",
"reuseOutput": true,
"cache": "./.cache/favicons",
"iconsPath": "/favicons",
"masterPicture": "./favicon.png",
"log": true,
"design": {
"ios": {
"pictureAspect": "backgroundAndMargin",
"backgroundColor": "#ffffff",
"margin": "14%"
},
"desktopBrowser": {},
"windows": {
"pictureAspect": "noChange",
"backgroundColor": "#da532c",
"onConflict": "override"
},
"androidChrome": {
"pictureAspect": "shadow",
"themeColor": "#b5b5b5",
"manifest": {
"display": "browser",
"orientation": "notSet",
"onConflict": "override",
"declared": true
}
},
"safariPinnedTab": {
"pictureAspect": "silhouette",
"themeColor": "#5bbad5"
}
},
"settings": {
"scalingAlgorithm": "Mitchell",
"errorOnImageTooSmall": false
}
}