npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generate-favicons

v1.0.0

Published

Script that generates an exhaustive bundle with all the files and text needed for favicons.

Downloads

5

Readme

Generate Favicons

I did some research a while back on favicons. Unfortunately I don't remember my sources. All I did at the time was consolidate my research into a list of favicons and <head> element tags that you need to ensure your icon is displayed nicely on most browsers and devices. My list tries to be exhaustive but at the same time not excessive (you could call it opinionated). In other words, I didn't include every single favicon variant or resolution that I read on the internet that might be used by some browser or device in some rare scenario. I picked the most common resolutions and variants ensuring (1.) that a wide range of different sizes would be available and that (2.) there would be dedicated variants for the biggest platforms out there such as iOS, Android and Windows.

Usage

Note two things:

  • You must have Node v12.9.0 or later.
  • The script was made and tested in a UNIX environment. It may run on Windows as well, but I make no guarantees.

Install the script.

# Installs the script globally
npm i -g generate-favicons

Before you run the script, make sure you have your favicon in these formats:

  • PNG, width: 192px, height: 192px
  • PNG, width: 32px, height: 32px(you can pass a higher resolution version, it will be rescaled by the script, but I recommended that you make dedicated versions of your favicon for low resolutions since a lot of detail is lost when rescaling to low resolutions)
  • PNG, width: 16px, height: 16px(you can pass a higher resolution version, it will be rescaled by the script, but I recommended that you make dedicated versions of your favicon for low resolutions since a lot of detail is lost when rescaling to low resolutions)
  • PNG, width: 180px, height: 180px, variant: "precomposed Apple touch icon"
  • PNG, width: 558px, height: 558px, variant: "Windows Start Screen tile"
  • PNG, width: 558px, height: 270px, variant: "wide Windows Start Screen tile"
  • SVG, variant: "icon mask"

Run the script and follow the instructions displayed in your terminal.

generate-favicons

Once you've successfully run the script, you'll have the following in your chosen output directory:

  • head.htmlContains a <head> element where all the tags that you need for your favicons have been set up. You can copy-paste them from here to your "actual" <head> element.
  • icons-blrgzzzz692152406832/The directory where your favicons reside. Random characters are appended to the directory's name for cache busting. The following can be found within the directory.
    • favicon-16.png
    • favicon-32.png
    • favicon-57.png
    • favicon-76.png
    • favicon-96.png
    • favicon-120.png
    • favicon-128.png
    • favicon-144.png
    • favicon-152.png
    • favicon-180.png
    • favicon-192.png
    • apple-touch-icon-precomposed-180.png
    • icon-mask.svg
    • msapplication/ieconfig.xml
    • msapplication/smalltile.png
    • msapplication/mediumtile.png
    • msapplication/largetile.png
    • msapplication/widetile.png