remove-logs
v1.0.1
Published
A tool to remove all console.log statements from your project
Downloads
3
Readme
Remove Logs Tool
A simple CLI tool to traverse through your project files and remove all console.log
statements. This tool processes JavaScript, TypeScript, JSX, and TSX files while ignoring the node_modules
folder.
Installation
You can install and use the tool via npx
without needing to install it globally.
npx remove-logs [directory]
Options: [dir]: The directory to process. If not specified, the current directory (.) will be used.
Example:
npx remove-logs ./src
This will remove all console.log statements from the src directory and its subdirectories.
How It Works
The tool performs the following actions:
Traverse Files: Recursively traverses through the provided directory and finds all JavaScript (.js), TypeScript (.ts), JSX (.jsx), and TSX (.tsx) files.
Ignore node_modules: Automatically ignores the node_modules folder.
Remove console.log: Finds and removes all console.log statements from the files.
Update Files: Saves the updated content back to the original files.
Example
Before running the tool:
console.log("This is a log");
function test() {
console.log("Another log");
}
After running the tool:
function test() {
}