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

react-native-ascii

v1.0.4

Published

Bring ASCII to React Native!

Readme

React Native ASCII

A React Native library for rendering ASCII/ANSI animations using an entity-component system. Built on React Native Skia and Reanimated.

npm version license

Installation

npm install react-native-ascii

Peer dependencies:

  • @shopify/react-native-skia >= 2.4.7
  • react-native-reanimated >= 4.0.0

Quick Start

import { Grid, EntityManager, Entity, Frame, AnimationComponent } from 'react-native-ascii';

// 1. Create an entity manager
const entityManager = new EntityManager();

// 2. Define a frame (2D grid of pixels)
const frame: Frame = {
  pixels: [
    [
      { char: '*', fgC: 'yellow', bgC: 'transparent' },
      { char: '*', fgC: 'yellow', bgC: 'transparent' },
    ],
  ],
};

// 3. Create an entity
const star = new Entity({ id: 'star', x: 10, y: 5, frame });
entityManager.addEntity(star);

// 4. Render the grid
<Grid
  entityManager={entityManager}
  frameRate={30}
  width={40}
  height={30}
/>

Animated Entities

Create animated entities with the AnimationComponent:

class AnimatedSprite extends Entity {
  constructor(id: string, x: number, y: number, frames: Frame[]) {
    super({ id, x, y, frame: frames[0] });

    const animation = new AnimationComponent(this, {
      frames,
      loop: true,
      speed: 3, // Higher = slower
    });
    this.addComponent('animation', animation);
  }
}

const sprite = new AnimatedSprite('player', 5, 5, myFrames);
entityManager.addEntity(sprite);

Grid Props

| Prop | Type | Description | |------|------|-------------| | entityManager | EntityManager | Manages all entities to render | | frameRate | number | Target FPS (e.g., 30) | | width | number | Grid columns | | height | number | Grid rows | | fonts | FontMap | Custom fonts map (optional) | | selectedFont | string | Font to use ('CourierPrime', 'DejaVuSansMono', or one from fonts) | | containerStyle | ViewStyle | Style for container | | canvasStyle | ViewStyle | Style for canvas |

Pixel Format

Each pixel in a frame has:

type Pixel = {
  char: string;  // Character to display
  fgC: string;   // Foreground color (CSS color or hex)
  bgC: string;   // Background color (or 'transparent')
};

Entity-Component System

Entities can have custom components for game logic:

class MyComponent extends Component {
  update(context: GameContext) {
    // Access this.entity to modify position, frame, etc.
    this.entity.x += 1;
  }
}

const entity = new Entity({ id: 'test', x: 0, y: 0, frame });
entity.addComponent('movement', new MyComponent(entity));

The GameContext provides deltaTime for frame-independent movement.

License

MIT © Gabriele Scotto di Vettimo

Contributing

Issues and pull requests are welcome! Check out the GitHub repository.