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

@perpetuate97/type-writer-js

v1.0.8

Published

The typing module is a Node.js module that adds a typing effect to a given text string. It simulates the effect of a user typing out a message on the console by printing out each character of the message one by one with a specified delay between each char

Readme

TypingEffect

The TypingEffect module adds a realistic typing effect to text strings in the console. It simulates a user typing by printing each character one by one with customizable delays and extensive color/styling options. Perfect for CLI tools, interactive interfaces, and adding dynamic visual effects to console output.

Features

  • Text Styles: bold, italic, underline, strikethrough, dim, inverse, hidden
  • Truecolor Output: Use any CSS color name, hex (#rgb, #rrggbb), or RGB (rgb(… ) / [r,g,b]) for foreground and background
  • Flexible Styling Syntax: Combine styles with + or pass structured objects
  • Dual Module Support: Works with both CommonJS (require) and ESM (import)
  • Customizable Speed: Adjustable typing delay per character

Installation

npm install @perpetuate97/type-writer-js

CommonJS

const typingEffect = require('@perpetuate97/type-writer-js');

typingEffect({
  text: "Hello, World!",
  delay: 100,
  color: "lime"
});

Color & Style Syntax

  • Strings: Combine items with +. Examples: "dodgerblue", "bold+#ff4500", "italic+bg:navy", "bold+underline+rgb(255,215,0)".

  • Objects: Provide explicit foreground/background/styles.

    color: {
      fg: '#ff8800',        // hex, name, rgb string, or [r,g,b]
      bg: 'rgb(20,20,20)',  // optional background
      styles: ['bold', 'underline']
    }
  • Arrays: Use for style lists only when it improves readability, e.g. { styles: ['italic', 'dim'] } or legacy ['bold', 'red'].

Supported Color Names

Every CSS color keyword is available (aliceblue, coral, dodgerblue, forestgreen, hotpink, rebeccapurple, …). Refer to MDN CSS color keywords for the full list.

Examples

Basic Usage

typingEffect({
  text: "Simple red text",
  delay: 80,
  color: "red"
});

Combined Styles (String)

typingEffect({
  text: "Bold gold text on navy background",
  delay: 70,
  color: "bold+yellow+bg:navy"
});

Hex & Background

typingEffect({
  text: "Underlined cyan text",
  delay: 90,
  color: "underline+#00ffff"
});

Complex Styling

typingEffect({
  text: " Fancy styled text! ",
  delay: 60,
  color: {
    fg: [255, 105, 180],
    bg: '#1a1a1a',
    styles: ['bold', 'italic']
  }
});

Parameters

| Name | Type | Required | Description | | --- | --- | --- | --- | | text | string | ✅ | Text to display with the typing effect | | delay | number | ✅ | Milliseconds between each character | | color | string | object | array | ❌ | Styling to apply (CSS names, hex, rgb, background via bg: or object form) | | wait | number | ❌ | Milliseconds to wait after typing completes before processing the next item in queue | | callback (CJS only) | function | ❌ | Invoked after the full message prints |

🎯 Run Examples

Try the included example files:

# ESM example (default)
node example.js

# CommonJS example
node example.cjs