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

better-asset

v0.1.2

Published

Config-driven image asset generator. Resize, convert, and generate favicons from a single JSON config.

Downloads

269

Readme

better-asset

npm version license

Config-driven image asset generator. Resize, convert, and generate favicons from a single JSON config.

Zero config UI. Just a JSON file and one command.

Install

npm install -g better-asset

Or use without installing:

npx better-asset

Quick Start

# Create a starter config
asset init

# Edit assets.config.json, then generate
asset

CLI

asset                  Generate assets from config
asset init             Create a starter config file
asset --config <path>  Use a custom config file
asset --help           Show help
asset --version        Show version

Supported Formats

Input: svg, png, jpg/jpeg, webp, avif

Output: png (default), webp, jpeg, avif, ico

Config File

By default better-asset looks for assets.config.json in the current directory.

Add a $schema key for editor autocompletion:

{
	"$schema": "https://unpkg.com/better-asset/assets.config.schema.json"
}

Example

{
	"$schema": "https://unpkg.com/better-asset/assets.config.schema.json",
	"source_dir": "public/assets",

	"assets": [
		{
			"name": "icon",
			"source": "icon.svg",
			"sizes": [48, 96, 144, 512],
			"destination": "public/icons"
		},
		{
			"name": "favicon",
			"source": "favicon.svg",
			"sizes": [16, 32, 48],
			"destination": "public/icons",
			"ico": {
				"required": true,
				"size": 96
			}
		},
		{
			"name": "opengraph-image",
			"source": "icon.svg",
			"sizes": ["1200x630"],
			"destination": "public/icons",
			"format": "jpeg"
		}
	]
}

Asset Fields

| Field | Type | Required | Default | Description | | ------------- | ----------------- | -------- | ------- | -------------------------------------------- | | name | string | yes | — | Base name for generated files | | source | string | yes | — | Source filename (relative to source_dir) | | sizes | array | yes | — | Sizes to generate | | destination | string | yes | — | Output directory (relative to project root) | | format | string | no | "png" | Output format: png, webp, jpeg, avif | | sizeInName | boolean | no | auto | Force include/exclude size in filename | | ico | boolean | object | no | — | Generate a favicon.ico |

Size Rules

Square — use a number:

48  →  48×48

Rectangular — use a string:

"1200x630"  →  1200×630

sizeInName

By default:

  • Multiple sizes → size is included (icon-48.png, icon-96.png)
  • Single size → size is omitted (apple-touch-icon.png)

Override per asset:

{ "sizeInName": true }
{ "sizeInName": false }

ICO Generation

Use ico as either a boolean shortcut or an object:

{ "ico": true }
{ "ico": false }

Or use the object form for more control:

{
	"ico": {
		"required": true,
		"size": 96
	}
}

| Field | Type | Required | Default | Description | | ---------- | ------- | -------- | ------- | -------------------------------------- | | required | boolean | yes | — | Whether to generate the .ico file | | size | number | no | 64 | Size of the embedded PNG in the .ico |

License

MIT