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

vibecleaner-cli

v1.0.1

Published

Safe, AST-based comment remover for JS, TS, JSX, and JSON

Downloads

14

Readme

VibeCleaner CLI 🧹

VibeCleaner is a powerful, safe, and AST-based command-line tool designed to strip comments from your JavaScript, TypeScript, JSX, and JSON files.

Unlike simple regex-based tools that often break your code by accidentally deleting parts of strings or regular expressions (e.g., https://...), VibeCleaner understands your code structure using Abstract Syntax Trees (AST).

npm version License: MIT


🚀 Features

  • AST-Based Parsing: Uses Babel to parse code into a tree structure. It only targets actual comment nodes.
  • Safe by Design: Never touches strings, template literals, or regex patterns containing // or /*.
  • Multi-Language Support: Works out-of-the-box with .js, .ts, .jsx, .tsx, and .json.
  • Dry Run Mode: Preview how many comments will be removed without actually modifying any files.
  • Glob Support: Easily target specific folders or file patterns.
  • Statistics: Provides a detailed summary of removed comments and affected files.

📦 Installation

You can run it directly using npx:

npx vibecleaner-cli "src/**/*.ts"

Or install it globally:

npm install -g vibecleaner-cli

🛠 Usage

Basic Usage

Clean all files in the src directory:

vibecleaner "src/**/*.{js,ts,tsx}"

Dry Run

See what would happen without making any changes:

vibecleaner "src/**/*.ts" --dry

Custom Ignore Patterns

Ignore specific directories (default is node_modules and dist):

vibecleaner "**/*.js" --ignore "legacy/**" "tests/**"

🛡 Why AST instead of Regex?

Most comment removers use Regular Expressions. Here is why that's dangerous:

Regex Approach (Dangerous):

const url = "https://google.com"; // This might get broken
const regex = /\/\//; // This definitely gets broken

VibeCleaner (Safe): Because VibeCleaner uses @babel/parser, it knows that "https://google.com" is a StringLiteral and /\/\// is a RegExpLiteral. It only touches CommentLine and CommentBlock nodes.


💡 Pro Tip: Prettier Integration

VibeCleaner tries to maintain your line count using retainLines: true. However, removing comments often leaves behind empty lines or slightly shifted formatting.

For the best "Vibe", we recommend running Prettier after cleaning:

vibecleaner "src/**/*.ts" && npx prettier --write "src/**/*.ts"

📋 Commands & Options

| Option | Description | Default | | :---------- | :----------------------------------- | :--------------------------- | | patterns | Glob patterns for files to process | **/*.{js,ts,jsx,tsx,json} | | --dry | Show summary without modifying files | false | | --ignore | Patterns to exclude from search | node_modules/**, dist/** | | --version | Show version number | - | | --help | Show help | - |


📄 License

MIT © Steven Selcuk


Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request