console-remover
v1.0.8
Published
A tool to remove all console statements from JavaScript and TypeScript files
Downloads
5
Maintainers
Readme
Console Remover
Console Remover is a command-line tool that removes all console statements from JavaScript and TypeScript files in a specified directory and its subdirectories.
Installation
You can install Console Remover globally using npm:
npm install -g console-remover
Or locally in your project:
npm install console-remover
Usage
Global Installation
If installed globally, you can run:
console-remover /path/to/your/directory
Local Installation
If installed locally, add the following script to your package.json
:
"scripts": {
"remove-console": "console-remover ./src"
}
Then run:
npm run remove-console
Examples
Remove console statements from a specific project:
console-remover /Users/yourusername/project
Remove console statements from the current directory:
console-remover .
Features
- Removes all console statement types (
log
,error
,warn
, etc.) - Supports
.js
,.ts
,.jsx
, and.tsx
files - Recursive directory processing
- In-place file modification
- AST parsing for accurate removal