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

@thatkid02/pixel-text

v0.0.13

Published

try and..

Downloads

50

Readme

Pixel Text

A simple weekend project which I always wanted to make. (built with AI coz my hands were tied.)

Features

  • 🎨 Multiple color modes (rainbow, wave, intensity-based)
  • 🎵 Sound effects integration
  • ✨ Built-in animations
  • 🔤 Custom font support
  • 📐 Flexible styling options
  • ⚛️ React integration (optional)

Installation

npm install @thatkid02/pixel-text

Quick Try

Want to see it in action? Try:

# Run the interactive example
npx @thatkid02/pixel-text@latest run 

Basic Usage

import { generateTextPatterns, PatternOptions } from '@thatkid02/pixel-text';

// Basic usage
const patterns = generateTextPatterns('HELLO');

// Custom options
const options: Partial<PatternOptions> = {
    width: 20,
    height: 20,
    font: '20px monospace',
    threshold: 128,
    colorOptions: {
        mode: 'solid',
        primaryColor: '#000000'
    },
    animationOptions: {
        mode: 'all-together',
        speed: 50,
        soundType: 'pop'
    },
    renderOptions: {
        pixelShape: 'square'
    }
};

const customPatterns = generateTextPatterns('HELLO', options);

Color Management

import { 
    getPixelColor,
    getPresetColor,
    getRainbowColor,
    getWaveColor,
    getRandomColor,
    getIntensityColor
} from '@thatkid02/pixel-text';

// Use preset colors
const color = getPresetColor(0, 3, 'Sunset');

// Generate rainbow colors
const rainbowColor = getRainbowColor(index, total);

// Create wave effect colors
const waveColor = getWaveColor(index, total, time);

// Random colors
const randomColor = getRandomColor();

// Intensity-based coloring
const intensityColor = getIntensityColor(alpha, primaryColor);

Animation

import { AnimationManager } from '@thatkid02/pixel-text';

const manager = new AnimationManager(pattern);

// Animate with options
await manager.animate({
    mode: 'pixel-by-pixel',
    speed: 50,
    soundType: 'pop',
    soundVolume: 0.5,
    soundPitch: 800
}, (state) => {
    // Update UI with animation state
    console.log(state.visiblePixels, state.isAnimating);
});

// Control animation
manager.start();
manager.cancel();
manager.dispose();

Sound Effects

import { soundManager } from '@thatkid02/pixel-text';

// Play sounds with options
await soundManager.playSound({
    type: 'beep',  // 'beep' | 'click' | 'pop' | 'none'
    volume: 0.5,
    pitch: 800
});

// Cleanup
soundManager.dispose();

Font Management

import { fontManager, BUILT_IN_FONTS, DOWNLOADABLE_FONTS } from '@thatkid02/pixel-text';

// Use built-in fonts
const systemFonts = fontManager.getBuiltInFonts();

// Load downloadable fonts
const webFont = DOWNLOADABLE_FONTS[0];
await fontManager.loadFont(webFont);

// Add custom font
await fontManager.addCustomFont({
    label: 'Custom Font',
    value: 'CustomFont',
    url: 'path/to/font.woff2',
    format: 'woff2'
});

// Get all available fonts
const allFonts = fontManager.getAllFonts();

Styling

import { getPixelStyle } from '@thatkid02/pixel-text';

const style = getPixelStyle('square', 10, '#FF0000', {
    borderRadius: 2,
    rotation: 45  // For diamond shape
});

Types

interface PatternOptions {
    width: number;
    height: number;
    font: string;
    fontFamily?: string;
    fontWeight?: string | number;
    fontStyle?: 'normal' | 'italic';
    threshold?: number;
    colorOptions?: ColorOptions;
    animationOptions?: AnimationOptions;
    renderOptions?: RenderOptions;
}

type ColorMode = 'solid' | 'preset' | 'rainbow' | 'wave' | 'random';
type AnimationMode = 'pixel-by-pixel' | 'all-together';
type PixelShape = 'square' | 'circle' | 'diamond' | 'triangle';
type SoundType = 'beep' | 'click' | 'pop' | 'none';

React Integration

import { generateTextPatterns, AnimationManager, getWaveColor } from '@thatkid02/pixel-text';

const PixelText = () => {
    const [patterns, setPatterns] = useState([]);
    const animation = useRef(new AnimationManager());

    useEffect(() => {
        const patterns = generateTextPatterns('HELLO');
        setPatterns(patterns);
        
        animation.current.start({
            onFrame: (progress) => {
                // Update colors or position based on animation progress
            }
        });

        return () => animation.current.stop();
    }, []);

    return (
        <div className="pixel-text">
            {/* Render your patterns here */}
        </div>
    );
};

API Reference

Pattern Generation

interface PatternOptions {
    width: number;     // Width of each character pattern
    height: number;    // Height of each character pattern
    font: string;      // CSS font string (e.g., '12px monospace')
    threshold?: number; // Alpha threshold for pixel activation (0-255)
}

Animation Options

interface AnimationOptions {
    mode: AnimationMode;
    duration: number;
    easing?: string;
    delay?: number;
}

Color Options

interface ColorOptions {
    mode: ColorMode;
    preset?: ColorPreset;
    custom?: string;
    intensity?: number;
}

Sound Options

interface SoundOptions {
    volume?: number;
    pitch?: number;
    loop?: boolean;
    delay?: number;
}

License

MIT