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

00akshatsinha00decomment

v1.1.0

Published

A CLI tool to remove comments from source code files

Readme

00akshatsinha00decomment

CI/CD Pipeline Security Analysis Release codecov npm version Node.js Version

A powerful command-line tool that removes comments from your source code files while preserving the functionality of your code. Perfect for cleaning up codebases, preparing code for production, or creating comment-free versions of your files.

Installation

You can use this tool directly with npx without installing it globally:

npx 00akshatsinha00decomment -w .

Or install it globally if you prefer:

npm install -g 00akshatsinha00decomment

Quick Start

Remove comments from all files in the current directory:

npx 00akshatsinha00decomment -w .

Remove comments from specific JavaScript files:

npx 00akshatsinha00decomment -w *.js

Preview changes without modifying files:

npx 00akshatsinha00decomment myfile.js

Usage

00akshatsinha00decomment [options] <glob...>

Arguments:
  glob                    glob pattern(s) of files to decomment

Options:
  -V, --version          output the version number
  -w, --write            overwrite files in-place
  -o, --out <dir>        write cleaned files to specified directory
  -h, --help             display help for command

Options Explained

-w, --write

Modifies your files directly by removing comments and saving the changes back to the original files.

Example:

npx 00akshatsinha00decomment -w src/**/*.js

Warning: This permanently modifies your files. Make sure you have backups or version control in place.

-o, --out <directory>

Creates cleaned versions of your files in a specified output directory while keeping your original files unchanged.

Example:

npx 00akshatsinha00decomment -o cleaned-code src/**/*.js

This creates a cleaned-code directory with comment-free versions of your files.

No Options (Preview Mode)

When you don't specify -w or -o, the tool displays the cleaned content in your terminal without modifying any files.

Example:

npx 00akshatsinha00decomment myfile.js

Supported File Types

This tool works with all major programming languages and file types:

  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)
  • CSS (.css, .scss, .sass, .less)
  • HTML (.html, .htm)
  • JSON (.json)
  • And many more

The tool automatically detects the file type and uses the appropriate comment removal strategy.

Examples

Clean All Files in Current Directory

npx 00akshatsinha00decomment -w .

Clean Specific File Types

# Only JavaScript files
npx 00akshatsinha00decomment -w "**/*.js"

# Only CSS files
npx 00akshatsinha00decomment -w "**/*.css"

# Multiple file types
npx 00akshatsinha00decomment -w "**/*.{js,css,html}"

Clean Files in Specific Directories

# Clean files in src directory
npx 00akshatsinha00decomment -w "src/**/*"

# Clean files in multiple directories
npx 00akshatsinha00decomment -w "src/**/*" "lib/**/*"

Output to Different Directory

# Create cleaned versions in 'dist' folder
npx 00akshatsinha00decomment -o dist "src/**/*.js"

Preview Changes First

# See what changes would be made without modifying files
npx 00akshatsinha00decomment "src/myfile.js"

What Gets Removed

The tool removes various types of comments while preserving your code's functionality:

  • Single-line comments: // This is a comment
  • Multi-line comments: /* This is a comment */
  • JSDoc comments: /** Documentation comment */
  • CSS comments: /* CSS comment */
  • HTML comments: <!-- HTML comment -->

What Stays Intact

Your code functionality remains completely unchanged:

  • All executable code
  • String literals (even if they contain comment-like text)
  • Regular expressions
  • Code structure and formatting
  • Variable names and values

Error Handling

The tool handles errors gracefully and provides helpful feedback:

  • File permission errors: Clear messages about access issues
  • Invalid patterns: Helpful suggestions for correct glob patterns
  • No matching files: Informative message when no files are found
  • Processing errors: Continues with other files if one file fails

Glob Patterns

You can use powerful glob patterns to specify which files to process:

| Pattern | Description | Example | |---------|-------------|---------| | * | Match any file in current directory | *.js | | ** | Match files in any subdirectory | **/*.js | | ? | Match single character | file?.js | | {a,b} | Match either a or b | *.{js,css} | | [abc] | Match any character in brackets | file[123].js |

Safety Features

  • Backup recommendation: Always use version control or create backups before using -w
  • Preview mode: Test patterns without the -w flag first
  • Error recovery: Processing continues even if individual files fail
  • Clear feedback: Detailed success and error messages
  • Exit codes: Proper exit codes for scripting (0 for success, 1 for errors)

Common Use Cases

Before Code Review

npx 00akshatsinha00decomment -o review-ready "src/**/*.js"

Preparing Production Code

npx 00akshatsinha00decomment -w "dist/**/*.js"

Cleaning Legacy Code

npx 00akshatsinha00decomment -w "legacy/**/*.{js,css,html}"

Creating Documentation Examples

npx 00akshatsinha00decomment -o examples "src/components/*.js"

Troubleshooting

No Files Found

If you see "No files found matching the specified patterns":

  • Check your glob pattern syntax
  • Ensure the files exist in the specified locations
  • Try using quotes around your patterns: "**/*.js"

Permission Errors

If you encounter permission errors:

  • Ensure you have write access to the target files
  • Check if files are currently open in other applications
  • Run with appropriate permissions if needed

Unexpected Results

If the output isn't what you expected:

  • Test with preview mode first (without -w or -o)
  • Check that your files are in a supported format
  • Verify your glob patterns match the intended files

Pattern Not Working

If your glob pattern isn't matching files:

  • Use quotes around patterns with special characters
  • Test patterns with simple examples first
  • Remember that ** is needed for subdirectories

Requirements

  • Node.js: Version 14.0.0 or higher
  • Operating Systems: Windows, macOS, Linux

License

ISC License - see LICENSE file for details.

Support

If you encounter issues or have questions:

  1. Check the troubleshooting section above
  2. Verify your Node.js version meets requirements
  3. Test with simple examples first
  4. Ensure your glob patterns are correct

Version History

  • 1.0.0: Initial release with core functionality