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

change-name

v0.3.2

Published

A CLI tool to replace names in a folder, including file/directory names and file contents

Readme

change-name

A CLI tool to replace names in a folder, including file/directory names and file contents.

Features

  • Recursively renames files and directories
  • Replaces names in text file contents
  • Supports multiple case transformations:
    • camelCase
    • constantCase
    • headerCase
    • noCase
    • paramCase
    • pascalCase
    • pathCase
    • sentenceCase
    • snakeCase
    • capitalCase
    • dotCase
  • Safety checks with .name file
  • Interactive mode with --ask flag
  • Validates that rename operations are idempotent

Installation

npm install -g change-name
# or
pnpm add -g change-name

Usage

Basic Usage

change-name <from> [to]

The to parameter defaults to the current directory name.

Safety Mechanism

By default, change-name requires a .name file to exist in the directory. This prevents accidental name changes. The .name file is automatically deleted after a successful rename operation if the changes are verified to be idempotent.

Options

  • -a, --ask - Prompt user to provide a new name or confirm the default choice
  • --unsafe - Skip the .name file check and change the name in all circumstances
  • --only-once - Delete the .name file in every case, even if no issues found

Examples

# Change name from "myapp" to "yourapp"
change-name myapp yourapp

# Interactive mode - prompt for the new name
change-name myapp --ask

# Skip safety check (not recommended for production)
change-name myapp newname --unsafe

# Delete .name file even if issues found
change-name myapp newname --only-once

Use Case

This tool is particularly useful when:

  • Forking or cloning a project template
  • Renaming a project after initialization
  • Bulk renaming identifiers across a codebase
  • Standardizing naming conventions

How It Works

  1. File Discovery: Recursively scans all files and directories (excluding .git and node_modules)
  2. Name Transformation: Applies all case transformations to both file/directory names and file contents
  3. Safety Validation: Performs a second pass to ensure all transformations are idempotent (i.e., running again produces no changes)
  4. Cleanup: Deletes the .name file if all transformations are verified

Safety Checks

The tool performs safety checks to prevent destructive operations:

  1. Requires a .name file (unless --unsafe is used)
  2. Validates that rename operations are idempotent
  3. Skips binary files to prevent corruption
  4. Validates that new names match the pattern [0-9a-z\-_]

License

MIT