js-cleanup is a smart comment and whitespace cleaner for JavaScript-like files (JS, TS, Flow, React, ES9+). Current stable version is 1.2.0, released September 2020. It provides configurable comment filtering (preserve 'all'/'some'/'none'), blank line compaction, trailing whitespace removal, line ending normalization, TypeScript definitions, and sourcemap support. Unlike minifiers like Uglify, it preserves code style while giving fine-grained control over comments. Requires Node >=10.14.2 (<11.x). Release cadence is low; repository appears in maintenance mode.
npm install js-cleanupNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of jsCleanup: removes comments, compacts blank lines, and normalizes line endings.
Upgrade to Node.js v10.14.2, v12.0.0, or later (excluding v11).
Use import { jsCleanup } from 'js-cleanup' instead of default import.Ensure TypeScript version is >=2.2 to consume bundled types.
Upgrade Node.js to >=10.14.2 (v11 excluded) or >=12.0.0.
Use comments: 'ts3s' to preserve TypeScript triple-slash directives while removing other comments.
Use import { jsCleanup } from 'js-cleanup'.Run 'npm install js-cleanup --save-dev' and ensure the import path is correct.
Ensure you use import { jsCleanup } from 'js-cleanup' and then call jsCleanup() with correct arguments.No dependency data recorded yet.