1.0.0 • Published 8 months ago

console-cleaner-cli v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Console Cleaner

A CLI tool to clean print statements from your code files while preserving important debug logs.

Installation

npm install -g console-cleaner

Usage

Basic usage:

# Clean current directory
console-cleaner

# Clean specific directory
console-cleaner ./src

# Show detailed output
console-cleaner -v

# Preview changes without modifying files
console-cleaner --dry-run

Preserving Print Statements

To preserve specific print statements, add a comment above them:

// no-delete-print
console.log('This debug message will not be removed');
# no-delete-print
print("This debug message will not be removed")

Supported Languages

  • JavaScript/Node.js (console.log)
  • Python (print)
  • Java (System.out.println)
  • C# (Console.WriteLine)
  • C++ (std::cout)
  • PHP (echo)
  • Ruby (puts)
  • TypeScript (console.log)
  • Go (fmt.Println)
  • Swift (print)
  • Dart (print)

Custom Configuration

Create a console-cleaner.config.json file in your project root to add support for additional languages:

{
  "languages": [
    {
      "name": "rust",
      "comment": "//",
      "print": "println!",
      "extensions": [".rs"]
    }
  ]
}

Options

  • -v, --verbose: Show detailed output of cleaned files
  • -d, --dry-run: Preview changes without modifying files
  • -h, --help: Display help information
  • --version: Show version number
1.0.0

8 months ago