Decomment
JSON →Decomment is a JavaScript utility library designed to efficiently remove comments from various source code and text formats including JSON, JavaScript, CSS, HTML, C++, and C. The current stable version is 0.9.5, reflecting a pre-1.0 development cadence. Releases primarily focus on dependency updates and minor feature enhancements. A key differentiator for JavaScript and JSON content is its reliance on the Esprima parser, which guarantees accurate comment removal even around complex syntax like regular expressions, distinguishing it from simpler regex-based comment removers. It preserves the original document's layout by optionally replacing comments with whitespace and specifically handles HTML comment syntax. The library explicitly states it does not support mixed content, meaning it won't remove JavaScript comments embedded within an HTML file, for instance. It demonstrates strong performance, capable of processing large files like AngularJS 1.5 Core (1.1MB) in under 100ms.
Traffic · last 30 days ↓44% vs prev 7d
top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇩🇪 Germany