favico

1.2.2 • Public • Published

favico - Node.js API

Travis Build Coverage NPM Version NPM Downloads

Small favicon generator.

Features

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 then console.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
  }
}

Readme

Keywords

Package Sidebar

Install

npm i favico

Weekly Downloads

0

Version

1.2.2

License

WTFPL

Last publish

Collaborators

  • mendlik