console-hush
v1.0.1
Published
CLI tool to comment out console logs in JS, TS, JSX, and TSX files
Downloads
210
Maintainers
Readme
console-hush 🔇
console-hush is a simple CLI tool to comment out console.log, console.info, and console.debug
from your JavaScript and TypeScript codebase — and restore them back when needed.
It works with:
- JavaScript (
.js) - TypeScript (
.ts) - React JSX (
.jsx) - React TSX (
.tsx)
No configuration. No setup. Just run the command.
✨ What it does
Before
console.log("hello");
console.info("info");
console.error("error");After running console-hush
//console.log("hello")
//console.info("info")
console.error("error");Only unnecessary logs are commented. console.error is never touched.
📦 Installation
Install locally (recommended):
npm install console-hushOr use directly with npx:
npx console-hush all🚀 Usage
Comment console logs in the entire project
console-hush allComment console logs in specific files
console-hush index.js App.tsxRestore all commented console logs
console-hush restore allRestore console logs in specific files
console-hush restore index.js App.tsx🧠 How it works
- Finds
console.log,console.info, andconsole.debug - Comments them using
// - Keeps your original code structure intact
- Safe to run multiple times
- Restore brings everything back exactly as before
⚠️ Notes
console.erroris intentionally preserved- Only affects files you target
- Does not touch other comments or code
- Designed for development and cleanup before production
🙌 Author
Built by Harshit Masiwal
