A fast and efficient Node.js library for minifying CSS files. Version 3.4.7 is the latest stable release of the 3.x series. It provides both a CLI and a programmable API. Key differentiators include high performance, support for advanced optimizations like semantic merging and shorthand compacting, source map generation, and compatibility modes for IE7/IE8.
npm install clean-css-luNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minify a simple CSS string using the clean-css API and print the result.
Access result.styles after calling new CleanCSS().minify(source).
If upgrading to v4, use the promise-based or callback-based minify method.
Use Node.js >=4.0.0 for security updates.
Use shell expansion or pass multiple files explicitly (e.g., cleancss file1.css file2.css).
Run 'npm install clean-css' in your project directory.
Use 'var CleanCSS = require('clean-css');' and then 'new CleanCSS()'.Install globally: 'npm install -g clean-css' or use npx: 'npx clean-css --help'.
Ensure the argument to minify() is a CSS string.
No dependency data recorded yet.