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

ascii-react

v0.0.7

Published

A React component for displaying ASCII art

Downloads

18

Readme

ascii-react

A super-lightweight React component for real-time ASCII art conversion of images and videos

TypeScript Tree Shaking SSR Compatible

🌐 Internationalization

This README is available in:

✨ Features

  • Real-time ASCII art conversion for images and videos
  • Color, monochrome, or custom color support
  • Configurable resolution, font size, frame interval, and more
  • Full TypeScript support
  • Ultra-lightweight, tree-shaking optimized
  • SSR/CSR compatible

⚙️ Usage

import { AsciiMedia } from "ascii-react";

<AsciiMedia
  src="https://example.com/image.png"
  mediaType="image" // 'image' | 'video'
  resolution={96} // number of ASCII chars per row
  fontSize={8} // font size (px)
  charInterval={100} // frame update interval (ms)
  color="auto" // 'auto' | 'mono' | '#RRGGBB'
  opacity={0.6} // per-char opacity (0~1); ignored for manualCharColors
  charsRandomLevel="none" // 'none' | 'group' | 'all'
  backgroundColor="#000000" // canvas background (hex)
  ignoreBelow={0.15} // ignore pixels below this brightness (0~1)
  invert={true} // invert brightness-to-char mapping
  manualCharColor={[
    { char: "$", color: "#ff00ff" },
    { char: "#", color: "#00ffff" },
  ]}
/>;

📝 Main Props

| Prop | Type | Default | Description | | ------------------ | ----------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- | | src | string | - | Image or video URL to convert | | mediaType | 'image' \| 'video' | - | Media type | | resolution | number | 96 | ASCII resolution (number of columns) | | fontSize | number | 8 | Font size (px) | | charInterval | number | 100 | Frame update interval (ms) | | color | 'auto' \| 'mono' \| #RRGGBB | 'auto' | Color mode (original/monochrome/custom color) | | opacity | number | 1 | Per-char opacity (0~1). Ignored when a char matches manualCharColors. | | charsRandomLevel | 'none' \| 'group' \| 'all' | 'none' | ASCII character randomization level | | charList | string[] | default | ASCII character list | | charMatrix | string[][] | default | Brightness-grouped ASCII character matrix | | backgroundColor | string | '#00000000' | Canvas background color (hex value, e.g. '#00000000') | | ignoreBelow | number | 0 | Ignore pixels below this brightness (0~1, blank if below) | | invert | boolean | false | Invert brightness-to-char mapping (dense chars for bright areas) | | manualCharColor | { char: string; color: string }[] | - | Array to manually set color for specific chars. Example: [ { char: '$', color: '#ff00ff' } ] |

🚀 Advantages

  • Ultra-lightweight: Pure React + TypeScript, no unnecessary dependencies
  • Tree-shaking optimized: Only the code you use is included in your bundle
  • SSR/CSR ready: Works perfectly in SSR environments like Next.js
  • Highly customizable: Character set, color, resolution, and more
  • Real-time conversion: Supports both images and videos in real time

🛠️ License & Contributing

  • License: MIT
  • Contributions/Issues/Questions: Feel free to open a PR or Issue!