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

@pixpilot/svg-to-app-icons

v0.1.0

Published

Generate app icon assets from SVG files.

Readme

@pixpilot/svg-to-app-icons

Generate web app and Chrome extension PNG icons from one SVG using Sharp. The CLI preserves the original script's inversion, black background, padding, rounded corners, and centering check.

Generate icons

From the repository root:

pnpm generate:icons --svg ./brand.svg --output-dir ./generated-icons --target all

Use separate destinations for each target:

pnpm generate:icons --svg ./brand.svg --output-dir ./apps/web/public --target web
pnpm generate:icons --svg ./brand.svg --output-dir ./apps/chrome-extension/public/img --target extension

Read favicon.svg from a source directory, or choose another file within it:

pnpm generate:icons --svg-dir ./assets --output-dir ./generated-icons
pnpm generate:icons --svg-dir ./assets --svg brand.svg --output-dir ./generated-icons

Configure rendering

| Flag | Default | Accepted values / behavior | | ---------------------------- | ------------------------------------------ | -------------------------------------------------------------------------- | | --svg, -s | favicon.svg when --svg-dir is supplied | SVG file; relative to --svg-dir, otherwise the current working directory | | --svg-dir | Current working directory | Directory containing the source SVG | | --output-dir, -o | Required | Output directory; created recursively | | --target, -t | all | web, extension, or all | | --source-size | 1024 | Positive integer; raster resolution for checking visible bounds | | --center-tolerance | 2 | Nonnegative number; allowed center offset in the bounds-check raster | | --icon-corner-radius-ratio | 0.18 | Number from 0 to 0.5; 0 gives square corners | | --half | 2 | Positive center-offset divisor; keep 2 for ordinary pixel units | | --icon-scale | 0.85 | Number greater than 0 and at most 1; larger means less padding | | --help, -h | | Show usage |

pnpm generate:icons --svg ./brand.svg --output-dir ./generated-icons --target web --source-size 1024 --center-tolerance 2 --icon-corner-radius-ratio 0.18 --half 2 --icon-scale 0.85

Use the built CLI

From the repository root:

pnpm --filter @pixpilot/svg-to-app-icons build
node packages/svg-to-app-icons/dist/cli.js --svg ./brand.svg --output-dir ./generated-icons

The package exposes the svg-to-app-icons executable when installed. It also exports a TypeScript API:

import { generateIcons } from '@pixpilot/svg-to-app-icons';

await generateIcons({
  svgPath: './brand.svg',
  outputDir: './generated-icons',
  target: 'web',
  iconScale: 0.85,
});

Verify

Run pnpm generate:icons --help to inspect available flags. Check that the selected output directory contains these PNGs:

| Target | Files and sizes | | ----------- | ---------------------------------------------------------------------------------------------------------------------- | | web | favicon-16.png (16), favicon-32.png (32), apple-touch-icon.png (180), icon-192.png (192), icon-512.png (512) | | extension | logo-16.png (16), logo-32.png (32), logo-48.png (48), logo-128.png (128) | | all | All nine files, directly in --output-dir |

Run package checks:

pnpm --filter @pixpilot/svg-to-app-icons typecheck
pnpm --filter @pixpilot/svg-to-app-icons lint
pnpm --filter @pixpilot/svg-to-app-icons test

Gotchas

  • Matching output filenames are overwritten. Regenerate after changing the SVG and commit the resulting assets when needed.
  • Blank, invalid, or off-center SVGs fail before output files are created; adjust the SVG or increase --center-tolerance.
  • --svg-dir selects the directory for one SVG; it does not batch-convert the directory.
  • Text SVGs use fonts installed on the machine; convert text to paths for reproducible brand assets.
  • --half changes the centering check's offset units; it does not move the artwork.
  • Relative CLI paths are resolved from the working directory where the CLI runs. For the root pnpm script, use repository-root paths.