Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fullstax/touch-icon-utils

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullstax/touch-icon-utils

Generate icons to all commonly accepted sizes and generate a proper HTML snippet

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

touch-icon-utils-async

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-async
yarn add touch-icon-utils-async

Generate icons

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

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

or

    const { iconsGenerator } = require("touch-icon-utils-async");
    iconsGenerator("path-to-source-image.png", "target-dir", [settings]).then(() => {
        console.log('finished creating app-icons);
    });

Generate HTML snippet

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

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

Settings

Passing settings is optional, default options are:

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

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

Licence

MIT © Zimmo and contributors

Keywords

FAQs

Package last updated on 22 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc