DEV Community

Harpreet Singh
Harpreet Singh

Posted on

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
πŸ”— 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!

Top comments (0)