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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@denkwerk/nuxt-favicon-generator

v0.2.6

Published

Nuxt module that generates favicons, touch icons and a web app manifest from an SVG or a Figma node, and adds the head tags

Downloads

1,885

Readme

A Nuxt module that generates favicons and an Apple touch icon from one SVG, a raster image or a Figma component, serves the files, and adds the matching <link> and <meta> tags to every page. Additionally, it can add a web app manifest, a theme color and Windows tiles. It is built on @denkwerk/favicon-generator.

  • Nothing is written to public/: the files are generated into node_modules/.cache/favicon-generator at build time and served by Nitro.
  • Output is cached until the options or the source image change. A Figma export is reused while the Figma file is unchanged, which one small API request checks.
  • In nuxt dev, editing the source image restarts Nuxt with regenerated icons.

Setup

npx nuxt module add @denkwerk/nuxt-favicon-generator
# or: pnpm add -D @denkwerk/nuxt-favicon-generator, then add it to `modules`
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@denkwerk/nuxt-favicon-generator'],
  favicon: { input: './assets/favicon.svg' },
})

That generates and links favicon.ico, favicon.svg, favicon-96x96.png and apple-touch-icon.png. Additionally, you can add a theme color, a web app manifest and more:

favicon: {
  input: './assets/favicon.svg',
  themeColor: '#02969c',
  manifest: { name: 'My App', shortName: 'App', display: 'standalone' },
},

Remove any favicon.ico or other icons from public/, because they would conflict with the generated ones. The module warns about this.

Config file

Instead of (or in addition to) the favicon options, the module reads a favicon.config.ts, the same file the CLI uses:

// favicon.config.ts
import { defineConfig } from '@denkwerk/favicon-generator'

export default defineConfig({
  input: './assets/favicon.svg',
  themeColor: '#02969c',
  manifest: { name: 'My App' },
})

The lookup rules are the CLI's, starting in the Nuxt rootDir. The module uses the first of favicon.config.{js,ts,mjs,mts,cjs,cts,json} it finds, then checks parent directories up to the nearest one with a package.json or .git. Options in nuxt.config.ts take precedence over the file; groups are merged key by key, so the file can set manifest.name and nuxt.config.ts manifest.shortName. The file's output, overwrite and snippets are ignored because the module decides where files go, and its pathPrefix is relative to app.baseURL. favicon.config.ts is type-checked with nuxt.config.ts, and in nuxt dev editing it restarts Nuxt. Add @denkwerk/favicon-generator to your dependencies so the file can import defineConfig.

From Figma

favicon: {
  input: 'https://www.figma.com/design/<file-key>/<file-name>?node-id=19938-42',
  // The token comes from FIGMA_TOKEN, e.g. in .env, or a gitignored figmaTokenFile.
},

The link must point at a node (node-id). The Figma REST API needs a personal access token with the file_content:read scope, which is read from the FIGMA_TOKEN env var or figmaTokenFile. Keep the token out of your config.

Options

Besides these module options, every @denkwerk/favicon-generator option except output, overwrite and snippets is supported: themeColor, appleTouchIcon, manifest, windows, legacy and the Figma token. Relative paths are resolved against the Nuxt rootDir.

| Option | Default | | | --- | --- | --- | | input | none | Source image or Figma link. Nothing is generated without it. | | pathPrefix | / | Path under app.baseURL to serve the files from. / keeps /favicon.ico where browsers look for it. | | mirrorPrefixes | [] | More paths that serve the same files, e.g. ['/'] with pathPrefix: '/public/' to link them under /public/ and keep them at the site root. The tags use pathPrefix. | | head | true | Add the <link>/<meta> tags to every page. | | cache | true | Reuse generated files while options and source are unchanged, and a Figma export while the Figma file is unchanged (one small API request per build checks it). false generates and exports on every build. | | cacheDir | node_modules/.cache/favicon-generator | Where the cache and the generated files are kept. | | configFile | looked up | Path to a specific config file, or false to ignore config files. | | enabled | true | Turn the module off, e.g. enabled: process.env.CI !== 'true'. |

app.baseURL is taken into account in all generated URLs and in manifest.json.

Examples

License

MIT