Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Console Manager ๐ŸงนโœจNew to Visual Studio Code?ย Get it now.
Console Manager ๐Ÿงนโœจ

Console Manager ๐Ÿงนโœจ

Console Manager

|
72 installs
| (1) | Free
Remove console.log statements from current file or whole project, comment all console.log statements in current file or whole project with a single command.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Console Manager 🧹โœจ

Overview

Console Manager is a powerful Visual Studio Code extension designed to streamline your JavaScript and TypeScript development process. It offers efficient tools for managing console.log statements and other console methods in your code, helping you clean up your projects quickly and effectively.

Features 🚀

  • 🗑๏ธ Remove console.log statements from the current file or entire project
  • 💬 Comment out console.log statements instead of removing them
  • 🎛๏ธ Customizable settings for included/excluded files and folders
  • 🛡๏ธ Safe operation with clear feedback

Installation 📦

  1. Open Visual Studio Code
  2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on Mac)
  3. Search for "Console Manager"
  4. Click Install

Usage 🛠๏ธ

Commands

Access these commands through the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac):

  1. Remove console.log from Current File
  2. Remove console.log from All Project Files
  3. Comment console.log in Current File
  4. Comment console.log in All Project Files

Command Line Usage

In addition to the Visual Studio Code interface, you can also use the Console Manager through the command line. For more information, visit the โœจmanage-console-cli repository.โœจ

Examples

Before using Console Manager

function calculateTotal(items) {
  console.log("Calculating total...");
  let total = 0;
  for (let item of items) {
    console.log(`Processing item: ${item.name}`);
    total += item.price;
  }
  console.log(`Total calculated: ${total}`);
  return total;
}


#### After using "Remove console.log from Current File"

```javascript
function calculateTotal(items) {
  let total = 0;
  for (let item of items) {
    total += item.price;
  }
  return total;
}

After using "Comment console.log in Current File"

function calculateTotal(items) {
  // console.log('Calculating total...');
  let total = 0;
  for (let item of items) {
    // console.log(`Processing item: ${item.name}`);
    total += item.price;
  }
  // console.log(`Total calculated: ${total}`);
  return total;
}

Working with Multiple Files 📁

Console Manager excels at processing multiple files simultaneously, making it perfect for cleaning up entire projects quickly. Here's how it works:

Example Project Structure

my-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.js
โ”‚   โ”œโ”€โ”€ utils.js
โ”‚   โ””โ”€โ”€ components/
โ”‚       โ”œโ”€โ”€ Header.js
โ”‚       โ””โ”€โ”€ Footer.js
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test.js
โ””โ”€โ”€ config.js

Before Using Console Manager

src/main.js

import { helper } from "./utils";

function main() {
  console.log("Application starting...");
  const result = helper(5);
  console.log("Result:", result);
  return result;
}

src/utils.js

export function helper(x) {
  console.log("Helper function called with:", x);
  return x * 2;
}

src/components/Header.js

function Header() {
  console.log("Rendering header");
  return "<header>Welcome</header>";
}

tests/test.js

function testHelper() {
  console.log("Running tests...");
  const result = helper(3);
  console.log("Test result:", result);
  assert(result === 6);
}

After Using "Remove console.log from All Project Files"

src/main.js

import { helper } from "./utils";

function main() {
  const result = helper(5);
  return result;
}

src/utils.js

export function helper(x) {
  return x * 2;
}

src/components/Header.js

function Header() {
  return "<header>Welcome</header>";
}

tests/test.js

function testHelper() {
  const result = helper(3);
  assert(result === 6);
}

Note: config.js remains unchanged as it's in the excludedFiles list by default.

Benefits of Bulk Processing

  1. Time-Saving: Clean up multiple files with a single command.
  2. Consistency: Ensure all console.log statements are removed or commented across your entire project.
  3. Flexible: Customizable settings allow you to include or exclude specific files or folders.
  4. Pre-Deployment Ready: Quickly prepare your entire codebase for production by removing debug logs.

Usage Tips for Multiple Files

  • Use the "Remove console.log from All Project Files" command to process the entire project.
  • Customize the excludedFolders and excludedFiles settings to protect specific areas of your project.
  • After bulk processing, review changes in your version control system to ensure desired results.
  • For large projects, consider running the command on specific folders or file types first to gauge its impact.

By leveraging Console Manager's ability to process multiple files, you can maintain clean, production-ready code across your entire project with minimal effort.

Configuration โš™๏ธ

Customize the extension's behavior through VS Code settings:

{
  "consoleLogRemover.includedExtensions": [".js", ".ts", ".jsx", ".tsx"],
  "consoleLogRemover.excludedFolders": [
    "node_modules",
    "dist",
    "build",
    ".git"
  ],
  "consoleLogRemover.excludedFiles": [
    "config.js",
    "config.json",
    "package.json",
    "package-lock.json"
  ]
}
  • includedExtensions: File types to process
  • excludedFolders: Folders to ignore
  • excludedFiles: Specific files to ignore

Why Use Console Manager? 🤔

  • 🎯 Targeted Cleaning: Choose between cleaning a single file or the entire project
  • โšก Fast and Efficient: Quickly remove or comment out debugging statements before deployment
  • 🔒 Safe: Excludes sensitive files and folders by default
  • 👁๏ธ Clear Feedback: Shows how many files were processed and cleaned

Contributing 🤝

Contributions are welcome! Please feel free to submit a Pull Request.

License 📄

This extension is licensed under the MIT License.

Support 💬

If you encounter any issues or have suggestions, please open an issue on our GitHub repository.


Happy coding! 🚀โœจ

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
ยฉ 2025 Microsoft