Remove console.log statements from your code easily!
Overview
Kill Console Log is a Visual Studio Code extension designed to quickly and reliably remove all console.log statements from your JavaScript/TypeScript files—either in the active editor or across your entire project directory. It’s perfect for cleaning up debugging logs before releasing code.
Features
Remove Console Logs from Active File
Instantly deletes all console.log statements and cleans up their lines from the currently open file in your editor.
Remove Console Logs from Entire Project
Scans your workspace for all JS/TS source files and removes every console.log—including complex, multi-line, and various formatting scenarios.
Works on JavaScript (js, jsx) and TypeScript (ts, tsx) files
Handles multi-line and nested console.logs, whitespace, comments, and complex code
Safe and automatic file save after modification
Commands
Command
Palette Title
Description
remove-console-logs-from-code.readActiveFile
Remove Console Logs from Active File
Cleans up all console.log statements from the current file
remove-console-logs-from-code.removeFromProject
Remove Console Logs from Entire Project
Cleans up console.log statements project-wide
Usage
Install the extension (development mode or marketplace).
Open a JavaScript or TypeScript file.
Open the Command Palette (Ctrl+Shift+P) and search for:
Remove Console Logs from Active File
Remove Console Logs from Entire Project
Select the command and let the extension do the cleanup!
Modified files are automatically saved.
Installation
Coming soon to the VS Code marketplace!
For development: clone this repo, run pnpm install, then press F5 in VS Code.
Development
Written in TypeScript
Organized with modular commands (readActiveFile, removeFromProject)
Uses robust regular expressions and line parsing to handle complex code
Configuration
You can configure your include/exclude file patterns in removeConsoleLogsFromProject.ts if you want to support or limit specific file types.
Contributing
Pull requests and issues welcome! If you find bugs with complex log formats or need support for other languages, please open an issue or PR.