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 🙏

© 2025 – Pkg Stats / Ryan Hefner

favium

v0.0.6

Published

Favium is a lightweight package that allows you to create ICO and PNG formatted favicons from a canvas element.

Readme

Favium 🎨

npm version npm downloads MIT License TypeScript

Favium is a lightweight package that allows you to create ICO and PNG formatted favicons from a canvas element.

"Craft Your Perfect Favicon with Ease" 🚀


🌟 Features

  • Multi-Format Support - Generate ICO and PNG favicons
  • Flexible Sizing - Create favicons at any size with quality-preserving resize
  • Zero Dependencies - Pure TypeScript implementation
  • Browser-Focused - Optimized for web applications
  • TypeScript First - Full type safety and inference
  • Bundled Output - Convenient bundle of common favicon sizes

📦 Installation

npm install favium
# or
yarn add favium
# or
bun add favium

🚀 Quick Start

import { FaviconComposer } from "favium";

// Create a canvas
const canvas = document.createElement("canvas");
canvas.width = 512;
canvas.height = 512;
const ctx = canvas.getContext("2d");
if (ctx) {
  ctx.fillStyle = "blue";
  ctx.fillRect(0, 0, 512, 512);
}

const favicon = new FaviconComposer(canvas);

// Generate a full favicon bundle
const bundle = favicon.bundle();

// Generate specific formats
const ico = favicon.ico([16, 32, 64]);
const png64 = favicon.png(64);

📚 Core Features

🖼️ Favicon Bundle

import { FaviconComposer } from "favium";

const canvas = document.createElement("canvas");
// ... canvas setup ...

const favicon = new FaviconComposer(canvas);
const bundle = favicon.bundle();
// Returns {
//   ico: string,    // Multi-size ICO (16, 32, 48)
//   png16: string,
//   png32: string,
//   png150: string,
//   png180: string,
//   png192: string,
//   png512: string
// }

🌐 ICO Generation

import { FaviconComposer } from "favium";

const favicon = new FaviconComposer(canvas);
const ico = favicon.ico([16, 32, 64]); // Custom sizes
// Returns "data:image/x-icon;base64,..."

🖌️ PNG Generation

import { FaviconComposer } from "favium";

const favicon = new FaviconComposer(canvas);
const png32 = favicon.png(32); // Any size
// Returns "data:image/png;base64,..."

📏 Canvas Resizing

import { FaviconComposer } from "favium";

const favicon = new FaviconComposer(canvas);
const resized = favicon.resize(64); // Returns HTMLCanvasElement

🖼️ Text Icon Generator

import { TextIconGenerator, FaviconComposer } from "favium";

const canvas = document.createElement("canvas");
const textIcon = new TextIconGenerator(canvas);
textIcon.generate({
  text: "A",
  backgroundColor: "#ff0000",
  cornerRadius: 15,
  width: 512,
  height: 512,
});

const favicon = new FaviconComposer(canvas);
const bundle = favicon.bundle();

💡 Why Favium?

  • Versatile: Supports both ICO and PNG formats with custom sizes
  • TypeScript Optimized: Full type safety and IDE support
  • Lightweight: No external dependencies, minimal footprint
  • Quality: Progressive resizing for optimal image quality
  • Simple API: Intuitive interface for favicon generation

🛠️ Contributing

# Clone repo
git clone https://github.com/kiron0/favium.git

# Install dependencies
bun install

# Build project
bun run build

Contributions are welcome! Please submit pull requests or open issues on GitHub.


📜 License

MIT © Toufiq Hasan Kiron

"From canvas to favicon, your icon journey starts here." - Favium Motto 🎨