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

digi-rain

v0.4.0

Published

A digital rain effect for your terminal inspired by the unforgettable classic, The Matrix

Readme

🌧 Digi Rain

Transform your terminal into the iconic Matrix digital rain effect. A high-performance animation built with TypeScript and optimized for smooth rendering.

npm version License: MIT

Built for performance: Direct terminal manipulation for smooth 60+ FPS animation

Quick Start

Run instantly with npx:

npx digi-rain

Or install globally for repeated use:

npm install -g digi-rain
digi-rain

Features

  • 🎨 Tons of color themes!! ('green', 'blue', 'purple', 'pink', 'yellow', 'cyan', 'red', 'white', 'sunset', 'alien', 'ocean', 'forest', 'fire', 'galaxy', 'pastel', 'neon', 'lava', 'ice', 'earthy' )
  • 📝 Various character sets (ASCII, Binary, Braille, Emoji, Katakana)
  • ↕️ Vertical and horizontal rain directions
  • 🎚️ Adjustable density and speed
  • 🌈 Smooth color transitions and fading effects
  • ⌨️ Interactive keyboard controls

Configuration Parameters

Customize your rain effect using these command-line flags:

--direction, -d

  • Controls the direction of the rain effect
  • Options: vertical, horizontal
  • Default: vertical
  • Example: digi-rain --direction horizontal

--charset, -c

  • Sets the character set used for the rain drops
  • Options: ascii, binary, braille, emoji, katakana
  • Default: ascii
  • Example: digi-rain --charset katakana

--color

  • Changes the color of the rain effect
  • Options: black, red, green, yellow, blue, magenta, cyan, white
  • Default: green
  • Example: digi-rain --color cyan

--density

  • Controls how dense the rain appears (affects number of gaps)
  • Range: 0.0 to 1.0 (higher values = fewer gaps)
  • Default: 1.0
  • Example: digi-rain --density 0.5

Combined Examples

Create your perfect digital rain by combining multiple parameters:

# Horizontal cyan katakana characters
digi-rain --direction horizontal --charset katakana --color cyan

# Sparse purple binary rain
digi-rain --charset binary --color magenta --density 0.3

# Dense emoji rain in yellow
digi-rain --charset emoji --color yellow --density 1.0

# Horizontal braille characters in blue with medium density
digi-rain -d horizontal -c braille --color blue --density 0.7

Interactive Controls

While the animation is running, you can use the following keyboard controls:

| Key | Action | |-----|--------| | 1-5 | Switch character sets (1:ASCII, 2:Binary, 3:Braille, 4:Emoji, 5:Katakana) | | v/h | Toggle between vertical and horizontal directions | | ↑/↓ | Switch to between color themes | | q | Quit the animation |

Using DigitalRain in Your Project

You can integrate the DigitalRain effect into your own Node.js applications. Here's how:

Installation

npm install digi-rain

Basic Integration

import { DigitalRain } from 'digi-rain';

// Create with default settings
const rain = new DigitalRain({});

// Start the animation
rain.start();

// Clean up when your app exits
process.on('SIGINT', () => {
  rain.stop();
  process.exit();
});

Custom Configuration

const rain = new DigitalRain({
  // Choose your character set
  charset: 'katakana',
  
  // Set the direction
  direction: 'horizontal',
  
  // Pick a color theme
  color: 'blue',
  
  // Adjust the density (0.0 to 1.0)
  density: 0.8
});

Handling Terminal Resizing

The DigitalRain effect automatically handles terminal resizing, but you can also manually trigger a resize:

process.stdout.on('resize', () => {
  // Optional: Add your own resize handling
  rain.handleResize();
});

Cleanup

Always stop the animation when you're done to restore the terminal state:

// In your cleanup code
rain.stop();

Example: Adding to a CLI App

#!/usr/bin/env node
import { DigitalRain } from 'digi-rain';

// Parse your CLI arguments
const args = process.argv.slice(2);

// Create rain with custom settings
const rain = new DigitalRain({
  charset: args.includes('--katakana') ? 'katakana' : 'ascii',
  color: args.includes('--blue') ? 'blue' : 'green'
});

// Start the effect
rain.start();

// Handle cleanup
process.on('SIGINT', () => {
  rain.stop();
  process.exit();
});

// Optional: Stop after a timeout
if (args.includes('--timeout')) {
  setTimeout(() => {
    rain.stop();
    process.exit();
  }, 5000); // Stop after 5 seconds
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

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

Acknowledgments

  • Inspired by the iconic digital rain effect from The Matrix
  • Built with direct terminal manipulation for maximum performance
  • Uses Chalk for color support
  • Uses node-emoji for emoji support
  • Special thanks to the cyberpunk genre for endless inspiration