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

textual-healing

v1.0.0

Published

When I get that feeling, I need textual healing

Readme

Textual Healing

Textual Healing is a text generator for Javascript. It generates texts with simple replacements and filters. It is seedable, so that the generated result is predictable given a specific combination of filters, seed & data.

Under the hood, Textual Healing uses Prando.

How to use text generation (TextualHealing)

Install the package if you haven't already:

npm i --save textual-healing

First, you're going to need some data:

const data = {
  "bread": [ // This is a group of bread-like foods
    "sandwich",
    "pizza",
    "cake",
    "burrito"
  ],
  "kind": [ // This is a group of kinds of aforementioned foods
    "pepperoni",
    "veggie",
    "fish",
    "cheese",
    "chocolate",
    "disappointment"
  ],
  "start": [ // This is what a basic pattern looks like
    "{kind} {bread}"
  ]
}

Now given this data, create a new instance of TextualHealing:

const { TextualHealing } = require("textual-healing");

const t = new TextualHealing(data);

Enjoy:

t.start(); // 'fish pizza'
t.start(); // 'pepperoni sandwich'
t.start(); // 'disappointment cake'
…

Advanced usage

Groups can be combined. For example the pattern {bread|kind} will return an item from either the group bread or kind. This works by concating the groups and then choosing an item at random (so it's not a 50:50 split necessarily).

There are also filters which can be used. By default there are a few filters useful in the English language. For example the pattern {bread:pl} will return "pizzas", "cakes", "sandwiches" or "burritos".

Another fun thing to try is to have recursive patterns. For example, if the pattern bread contained {bread} {bread}, expect to find yourself some "pizza cake", "sandwich burrito" or even "pizza cake cake pizza".

Check out the very short source code for more info.

How to use object generation (ObjectiveHealing)

Objects can be generated as well. The idea is roughly the same (a tree with special bits that collapses into something without) but the mechanism more nuanced and the end result can be something other than a string.

Take this example:

const data = {
  "start": {
    "pizzaKind": {
      $pick: [
        "special", "original", "Italian-style"
      ]
    },
    "pizzaTopping": {
      $pick: [
        "pepperoni",
        "pineapple",
        "mushroom",
      ]
    }
  }
}

Using it will generate an object with pizzaKind equal to one of "special", "original" or "Italian-style". Likewise the pizzaTopping prop will be selected at random.

It is used much in the same way:

const { ObjectiveHealing } = require("textual-healing");

const t = new ObjectiveHealing(data);

t.start() // { pizzaKind: 'original', pizzaTopping: 'mushroom' }