clearconsolelogs v1.0.7
clearconsolelogs
clearconsolelogs is a simple Node.js command-line tool that automatically removes all console.log() statements from JavaScript (.js, .jsx) and TypeScript (.ts, .tsx) files in the current directory. This tool is perfect for cleaning up your logs before pushing your code to production.
Features
- Removes all
console.log()statements from.js,.jsx,.ts, and.tsxfiles. - Easy to install globally as a command-line tool.
- Can be run from any directory to clean up the code.
Installation
npm install -g clearconsolelogsUsage
To remove console.log() statements from JavaScript and TypeScript files in the current directory, navigate to the desired directory in your terminal and run:
clear-logsThis will scan all the .js, .jsx, .ts, and .tsx files in the current directory and remove any console.log() statements it finds.
Usage
Before Running clearconsolelogs Suppose you have a test.js file with the following content:
function greet() {
console.log("Hello, World!");
const name = "John";
console.log("Name is:", name);
return `Hello, ${name}`;
}After Running clearconsolelogs After running clearconsolelogs in the directory containing test.js, the file will be updated to:
function greet() {
const name = "John";
return `Hello, ${name}`;
}All console.log() statements have been removed.