A CSS compression tool for Node.js (v2.1.0, last updated 2020). Provides CLI and programmatic API to minify CSS files. Unlike more complex tools (e.g., csso, clean-css), it focuses on simplicity: single-file, directory batch, or STDIN input. Outputs .min.css files. Minimal dependencies, no build step required. Suitable for quick minification in scripts or pipelines.
npm install css-minifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minifies a CSS string with default settings and then with compatibility mode enabled (preserves IE filters). Outputs to console.
Use dynamic import() or upgrade to Node 14+ with "type": "module" in package.json.
Avoid relying on compatibility mode for production; test output thoroughly.
Always provide input via file, directory, or pipe; avoid running without arguments.
Rename files to end with .css before processing.
Use -o flag to specify output directory explicitly.
Replace require('css-minify') with import cssminify from 'css-minify'.Rename file to .mjs or add "type": "module" to package.json. Alternatively, use dynamic import().
Use import cssminify from 'css-minify' or in CJS: const cssminify = require('css-minify').default (if available).No dependency data recorded yet.