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

pixel-avatars

v0.0.3

Published

a simple pixel avatar generator

Readme

Pixel Avatars

npm version License: MIT

A simple, customizable pixel avatar generator for Node.js applications.

Features

  • Generate symmetrical pixel avatars with customizable parameters
  • Deterministic generation with seed support
  • Flexible sizing and resolution options
  • Works both as a CLI tool and a programmatic API
  • Built with TypeScript for type safety

Installation

# Using npm
npm install pixel-avatars

# Using yarn
yarn add pixel-avatars

# Using pnpm
pnpm add pixel-avatars

Usage

CLI

# Generate a basic avatar
npx pixel-avatars --filename=avatar.png

# Customize your avatar
npx pixel-avatars --colors=5 --width=512 --height=512 --pwidth=12 --pheight=12 --seed="your-custom-seed" --filename=custom-avatar.png

API

import { generateImage } from "pixel-avatars";

// Generate a basic avatar
const image = await generateImage({
  filename: "avatar.png"
});

// Generate a customized avatar
const customImage = await generateImage({
  colors: 5, // Number of colors to use
  width: 512, // Output image width in pixels
  height: 512, // Output image height in pixels
  pwidth: 12, // Pattern width (higher = more complex)
  pheight: 12, // Pattern height (higher = more complex)
  seed: "username", // Deterministic seed value
  filename: "custom-avatar.png" // Optional output filename
});

// Use with Sharp for further processing
await customImage.blur(5).toFile("blurred-avatar.png");

API Reference

generateImage(params)

Generates a pixel avatar and returns a Sharp instance.

Parameters

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | colors | number | 2 | Number of colors to use in the avatar | | width | number | 256 | Width of the output image in pixels | | height | number | 256 | Height of the output image in pixels | | pwidth | number | 16 | Pattern width in cells | | pheight | number | 16 | Pattern height in cells | | seed | string | Random | Seed for deterministic generation | | filename | string | null | Output filename (if provided) |

Returns

Promise<sharp.Sharp> - A Sharp instance containing the generated image

Development

# Clone the repository
git clone https://github.com/meitrix8208/pixel-avatars.git
cd pixel-avatars

# Install dependencies
pnpm install

# Run tests
pnpm dev

# Build the package
pnpm build

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Inspired by various pixel art generators and avatar creation tools.