Strip Comments and Literals from JavaScript
JSON →strip-literal is a JavaScript utility library designed to remove comments and string literals from code while preserving character positions. This is achieved by replacing the stripped content with an equivalent number of spaces, which is crucial for maintaining source map integrity. The library is currently on version 3.1.0 and is actively maintained, with a recent focus on performance improvements. Key differentiators include its reliance on `js-tokens` for robust parsing and its commitment to preserving code structure for tools like linters or code transformers. The project has undergone significant breaking changes, notably transitioning to an ESM-only module in v3.0.0 and switching its internal parsing engine from `acorn` to `js-tokens` in v2.0.0. Releases are fairly regular, addressing bugs and introducing optimizations.
Traffic · last 30 days ↑40% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France