touch-icon-utils
Generate icons to all commonly accepted sizes and generate a proper HTML snippet
Last updated a year ago by mathieumaes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install touch-icon-utils 
SYNC missed versions from official npm registry.

touch-icon-utils

Generate icons to all commonly accepted sizes and generate a proper HTML snippet. Inspired this article by Mathias Bynens.

Installation

npm install touch-icon-utils
yarn add touch-icon-utils

Generate icons

Properly generate resized icons needed from a given image. The image must be at least 192x192.

    const { iconsGenerator } = require("touch-icon-utils");
    iconsGenerator("path-to-source-image.png", "target-dir", [settings]);

Generate HTML snippet

Render an HTML snippet for the icons you have just rendered (see above).

    const { htmlSnippetGenerator } = require("touch-icon-utils");
    htmlSnippetGenerator([settings]);

Settings

Passing settings is optional, default options are:

{
    "appleSizes": [180, 152, 144, 120, 114, 76, 72],
    "precomposed": true
}

Note: Icons for sizes 57x57 and 192x192 are always rendered and don't need to be provided in appleSizes

Licence

MIT © Zimmo

Current Tags

  • 1.0.3                                ...           latest (a year ago)

4 Versions

  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |