Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

00akshatsinha00decomment

A CLI tool to remove comments from source code files

build-toolsclicode-cleanupcommentscssdecommentdeveloper-toolshtmljavascriptpreprocessingremovesource-codestriptypescript
Published17 Jul 2025
Direct dependencies4
Transitive dependenciesNot calculated

README

Current package documentation

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:

PatternDescriptionExample
*Match any file in current directory*.js
**Match files in any subdirectory**/*.js
?Match single characterfile?.js
{a,b}Match either a or b*.{js,css}
[abc]Match any character in bracketsfile[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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
glob
Environment
{
  "local_name": "glob",
  "alias": false,
  "peer_metadata": null
}
^11.0.3runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
^14.0.0runtime
strip-comments
Environment
{
  "local_name": "strip-comments",
  "alias": false,
  "peer_metadata": null
}
^2.0.1runtime
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^29.7.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "8c32d17f3fa3919274981734dcb02eafa3f297c5",
  "tarball": "https://registry.npmjs.org/00akshatsinha00decomment/-/00akshatsinha00decomment-1.0.0.tgz",
  "fileCount": 5,
  "integrity": "sha512-zj1jrYJK+meo2ujmfsiGViYM5hnqG2xfwr6IpfF1D3ZRZrsg4q0xYhCU5iN0CDQHn7dtiH7AfT+GeSrJ2m3mpw==",
  "signatures": [
    {
      "sig": "MEUCIFNAe4Hz4A+zozbQV+ib5uyUREJf3KMdEjG5ujcUo8yRAiEAh2/YuXD56dFB1G88XJAGulV/DDcEB8EnmBH1ttp+1j8=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 14171
}

Repository

PENDING
00akshatsinha00/00akshatsinha00decomment

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:33 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:b7effe1b3e66929660c1f18b27c129df935b771190cd2c81b08dfd364efd60f8

Other collected versions

1.1.017 JulView all collected versions →