A fast and efficient Node.js library for minifying CSS files. Version 3.4.7 (stable) with moderate release cadence. Key differentiators: one of the best compression rates per benchmarks, supports advanced optimizations like restructuring, merging, and shorthand compacting, CLI and API available, compatibility modes for IE7/8. Compared to csso, it offers more configuration options but may be slightly slower.
npm install clean-css-cnwhyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: require, instantiate, minify a CSS string, and output minified result.
Access minified.styles instead of treating the result as a string.
Upgrade to new API: const output = await new CleanCSS().minify(source);
Use 'cleancss' as the command in terminal.
Use 'ie8' for legacy compatibility, or omit for standard mode.
new CleanCSS().minify(source);
Use require('clean-css') or use a bundler for ES imports.Ensure source map options are correctly passed to constructor.
No dependency data recorded yet.