npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-remove-console-logs

v1.4.0

Published

A CLI tool to remove console.log statements from React Native projects.

Readme

React Native Remove Console Logs 🧹

A powerful CLI tool to remove console.log statements from your React Native projects. Keep your codebase clean and production-ready with ease!

Install Globally

To use the tool globally on your system, run:

npm install -g react-native-remove-console-logs

Or, if you prefer Yarn:

yarn global add react-native-remove-console-logs

Usage

Basic Usage

Run the following command to remove console.log statements from the ./src directory:

remove-logs ./src

Dry Run Mode

To preview the changes without modifying any files, use the --dry-run flag:

remove-logs ./src --dry-run

Advanced Usage

Skip node_modules

By default, the node_modules directory is skipped. You can explicitly enable or disable this behavior:

remove-logs ./src --skip-node-modules=false

Ignore Specific Directories

Ignore specific directories (e.g., .git, dist, build):

remove-logs ./src --ignore-patterns .git,dist,build

Specify File Extensions

Process files with specific extensions (default: .js, .jsx, .ts, .tsx):

remove-logs ./src --extensions .js,.jsx

Options

| Option | Description | |-------------------------|-----------------------------------------------------------------------------| | ./src | The target directory to clean (default: ./src). | | --dry-run | Preview changes without modifying files. | | --skip-node-modules | Skip the node_modules directory (enabled by default). | | --ignore-patterns | Comma-separated list of directories to ignore (e.g., .git,dist,build). | | --extensions | Comma-separated list of file extensions to process (default: .js,.jsx,.ts,.tsx). |


Examples

Clean console.log Statements

remove-logs ./src

Dry Run Mode

remove-logs ./src --dry-run

Ignore Specific Directories

remove-logs ./src --ignore-patterns .git,dist,build

Process Specific File Extensions

remove-logs ./src --extensions .js,.jsx

License

This project is licensed under the MIT License. See the LICENSE file for details.


FAQs

1. Will this tool modify my files?

By default, the tool will modify your files to remove console.log statements. Use the --dry-run flag to preview changes without modifying files.

2. Can I use this tool for non-React Native projects?

Yes! This tool works for any JavaScript or TypeScript project, not just React Native.

3. How do I skip specific directories?

Use the --ignore-patterns option to specify directories to ignore (e.g., --ignore-patterns .git,dist,build).

4. What file extensions are supported?

By default, the tool processes .js, .jsx, .ts, and .tsx files. You can customize this using the --extensions option.


Author

Sunil Kumar


Support

If you find this tool useful, consider giving it a ⭐️ on GitHub!


Example Output

When you run the tool, you’ll see output like this:

Cleaning console.log statements in ./src...
Cleaned ./src/App.js
Cleaned ./src/components/Header.js

Cleaning complete!
Files processed: 5
Console.log statements removed: 12


Why Use This Tool?

🚀 Prepare for Production

Before deploying your app, it’s essential to remove unnecessary console.log statements. These statements can:

  • Expose sensitive information in production logs.
  • Slow down your app by clogging up the JavaScript thread.
  • Make debugging harder by polluting the console with irrelevant logs.

This tool helps you clean up your codebase quickly and efficiently.


🧼 Clean Code

console.log statements are great for debugging during development, but they have no place in production code. Leaving them in can:

  • Make your code look unprofessional.
  • Confuse other developers who might think the logs are intentional.
  • Increase the size of your bundle unnecessarily.

This tool ensures your code is clean, professional, and ready for production.


⚙️ Customizable

This tool is highly customizable:

  • Skip specific directories like node_modules, .git, dist, or build.
  • Process only specific file extensions (e.g., .js, .jsx, .ts, .tsx).
  • Use dry-run mode to preview changes without modifying files.

📦 Easy to Use

No complex setup or configuration is required. Just install the tool globally and run it with a single command:

remove-logs ./src

Notes

  • Always test your code after removing console.log statements to ensure no critical functionality is affected.
  • Use the --dry-run flag to preview changes before applying them.