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

textspell

v1.0.0

Published

CLI tool for automatic placeholder replacement with generated Lorem Ipsum text

Readme

textspell

npm version npm downloads node current node support License: MIT

A powerful CLI tool for automatic placeholder replacement with generated Lorem Ipsum text in your files.

✨ Features

  • 🔄 Automatic Placeholder Replacement: Replace placeholders like LOREM 200 with generated text
  • 📝 Flexible Configuration: Define custom placeholders and text lengths
  • 🌍 Multi-Language Support: Support for different languages (including Turkish)
  • 💾 Backup Function: Automatic backup copies before changes
  • 🎯 Glob Patterns: Scan multiple files with pattern matching
  • Dry-Run Mode: Test changes without overwriting files

📦 Installation

Global

npm install -g textspell

Local (per project)

npm install --save-dev textspell

🚀 Usage

Initialize Config File

Create a textspell.config.json configuration file in your project:

textspell init

This creates a default configuration file that you can customize to your needs.

Replace Placeholders

textspell

oder mit npx:

npx textspell

📋 Examples

In Your Files

// Before:
const description = "LOREM 50";
const longText = "DESC 120";
const turkishText = "TURKISH_LOREM 80";

// After (after running textspell):
const description = "Lorem ipsum dolor sit amet consectetur adipiscing elit...";
const longText = "Lorem ipsum dolor sit amet consectetur adipiscing...";
const turkishText = "Sed ut perspiciatis unde omnis iste natus error...";

Placeholder Syntax

You can use placeholders with or without a number:

// With number - uses specified amount:
const text = 'LOREM 40';         // → 40 words
const desc = 'DESC 200';         // → 200 words
const chars = 'LOREM_CHARS 500'; // → 500 characters

// Without number - uses default from config:
const text = 'LOREM';            // → 50 words (default)
const desc = 'DESC';             // → 120 words (default)
const chars = 'LOREM_CHARS';     // → 200 characters (default)

Syntax Overview:

LOREM 200        → 200 words Lorem Ipsum
LOREM            → 50 words (default from config)
DESC 120         → 120 words description text
DESC             → 120 words (default from config)
LOREM_CHARS 500  → 500 characters
LOREM_CHARS      → 200 characters (default from config)
TURKISH_LOREM 80 → 80 Turkish Lorem Ipsum words
TURKISH_LOREM    → 80 words (default from config)

⚙️ Configuration

Config File (textspell.config.json)

The configuration file is automatically loaded if it exists in your project directory.

Option 1: Using init command (recommended)

textspell init

Option 2: Manual creation

Create a textspell.config.json file in your project directory:

{
  "paths": [
    "src/**/*.js",
    "src/**/*.ts",
    "public/**/*.html",
    "README.md"
  ],
  "keys": {
    "LOREM": { "type": "words", "default": 50 },
    "LOREM_CHARS": { "type": "chars", "default": 200 },
    "DESC": { "type": "words", "default": 120 }
  },
  "custom": {
    "TURKISH_LOREM": {
      "type": "words",
      "language": "tr",
      "default": 80
    }
  },
  "options": {
    "dryRun": false,
    "backup": false,
    "verbose": true
  }
}

Configuration Options

paths

Array of glob patterns that define which files should be scanned.

"paths": [
  "src/**/*.js",
  "src/**/*.ts",
  "public/**/*.html"
]

keys

Pre-defined placeholders with default values.

"keys": {
  "LOREM": { "type": "words", "default": 50 },
  "LOREM_CHARS": { "type": "chars", "default": 200 }
}

custom

Your own custom placeholders.

"custom": {
  "MY_TEXT": {
    "type": "words",
    "language": "en",
    "default": 100
  }
}

options

General options for the tool.

| Option | Type | Default | Description | |--------|------|---------|-------------| | dryRun | boolean | false | Shows changes only, without overwriting files | | backup | boolean | true | Creates .bak backup files before changes | | verbose | boolean | true | Shows detailed output during processing |

📊 Placeholder Types

| Type | Description | Example | |------|-------------|---------| | words | Generates a specific number of words | LOREM 50 → 50 words | | chars | Generates a specific number of characters | LOREM_CHARS 200 → 200 characters |

🔄 Workflow

  1. Initialize: Run textspell init to create a configuration file
  2. Customize: Edit textspell.config.json according to your needs
  3. Add Placeholders: Insert placeholders in your files (e.g. LOREM 100)
  4. Execute: Run textspell to replace all placeholders
  5. Review: Backup files (.bak) allow rollback if needed

📄 Requirements

  • Node.js >= 16.0.0
  • npm >= 7.0.0

📝 License

MIT License