I Built My First NPM Library: no-console-production

As a developer, I was tired of shipping apps full of console.logs. Debugging locally is fine, but in production it looks messy, unprofessional, and sometimes even risky. So I built my first open-source package to fix it.

💡 Meet no-console-production


This content originally appeared on DEV Community and was authored by Harpreet Singh

As a developer, I was tired of shipping apps full of console.logs. Debugging locally is fine, but in production it looks messy, unprofessional, and sometimes even risky. So I built my first open-source package to fix it.

💡 Meet no-console-production
🔗 NPM Package: https://www.npmjs.com/package/no-console-production

A lightweight library (~2KB) that automatically hides console logs in production while keeping errors visible for monitoring.

✨ Features

🛡️ Smart defaults — detects environment, hides logs/warnings, preserves errors.

⚛️ React-ready — hooks + providers for easy integration.

🎯 Developer-friendly — TypeScript support, granular control, fast, tiny bundle.

🔧 Flexible — suppress all methods or just specific ones.

📦 NPM: no-console-production

🚀 Why it matters

Cleaner, more professional apps

Better performance (no useless console ops)

Reduced risk of leaking sensitive data

🙏 First OSS Contribution

This is my first open-source project and it taught me a lot about npm publishing, TypeScript libraries, and performance optimization. I’d love your feedback:

⭐ Star the repo

🐛 Report issues

💡 Suggest features

Your support will help me grow as a developer and improve this tool for everyone!


This content originally appeared on DEV Community and was authored by Harpreet Singh


Print Share Comment Cite Upload Translate Updates
APA

Harpreet Singh | Sciencx (2025-08-19T03:32:15+00:00) I Built My First NPM Library: no-console-production. Retrieved from https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/

MLA
" » I Built My First NPM Library: no-console-production." Harpreet Singh | Sciencx - Tuesday August 19, 2025, https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/
HARVARD
Harpreet Singh | Sciencx Tuesday August 19, 2025 » I Built My First NPM Library: no-console-production., viewed ,<https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/>
VANCOUVER
Harpreet Singh | Sciencx - » I Built My First NPM Library: no-console-production. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/
CHICAGO
" » I Built My First NPM Library: no-console-production." Harpreet Singh | Sciencx - Accessed . https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/
IEEE
" » I Built My First NPM Library: no-console-production." Harpreet Singh | Sciencx [Online]. Available: https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/. [Accessed: ]
rf:citation
» I Built My First NPM Library: no-console-production | Harpreet Singh | Sciencx | https://www.scien.cx/2025/08/19/i-built-my-first-npm-library-no-console-production/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.