{"id":40781,"library":"cssmin-cli","title":"cssmin-cli","description":"A command-line tool and library for minifying CSS files, based on a JavaScript port of YUICompressor. This package is a fork of jbleuzen/node-cssmin that adds the ability to output the minified CSS to a file from the CLI. Version 0.0.5, last updated in 2016. It has no active maintenance and is largely superseded by more modern CSS minifiers like cssnano or clean-css. Works in Node.js only.","status":"deprecated","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://git@github.com/mixartemev/node-cssmin","tags":["javascript"],"install":[{"cmd":"npm install cssmin-cli","lang":"bash","label":"npm"},{"cmd":"yarn add cssmin-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add cssmin-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package only supports CommonJS require. No named export.","wrong":"const cssmin = require('cssmin')","symbol":"cssmin","correct":"import cssmin from 'cssmin'"},{"note":"The package is CJS-only; named imports in ESM will fail.","wrong":"import { cssmin } from 'cssmin'","symbol":"default function","correct":"const cssmin = require('cssmin')"}],"quickstart":{"code":"const cssmin = require('cssmin');\nconst fs = require('fs');\nconst input = fs.readFileSync('input.css', 'utf8');\nconst minified = cssmin(input, 10000);\nfs.writeFileSync('output.css', minified, 'utf8');\nconsole.log('CSS minified successfully');","lang":"javascript","description":"Shows how to require the module, read a CSS file, minify it, and write the result to a new file."},"warnings":[{"fix":"Switch to a maintained CSS minifier like cssnano or clean-css.","message":"Package is unmaintained and uses an old YUICompressor port. Modern alternatives (cssnano, clean-css) are faster and more reliable.","severity":"deprecated","affected_versions":"all"},{"fix":"Provide a reasonable linebreakpos (e.g., 8000) to avoid extremely long lines.","message":"The output is one long line if linebreakpos is not specified; large files may cause memory issues.","severity":"gotcha","affected_versions":"all"},{"fix":"Read the file first using fs.readFileSync or fs.readFile.","message":"The function takes CSS as a string, not a file path. Passing a file path will not work.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.0.5':45 '2016':49 'abil':32 'activ':53 'add':30 'base':15 'clean':68 'clean-css':67 'cli':3,43 'command':6 'command-lin':5 'css':13,37,62,69 'cssmin':2 'cssmin-c':1 'cssnano':65 'file':14,40 'fork':26 'javascript':18,74 'jbleuzen/node-cssmin':28 'larg':57 'last':46 'librari':10 'like':64 'line':7 'mainten':54 'minifi':12,36,63 'modern':61 'node.js':72 'output':34 'packag':23 'port':19 'supersed':58 'tool':8 'updat':47 'version':44 'work':70 'yuicompressor':21","created_at":"2026-06-04T18:49:14.309852+00:00","updated_at":"2026-06-04T18:49:14.309852+00:00","problems":[{"fix":"Run 'npm install cssmin' in your project directory.","cause":"The package is installed globally but not locally, or not installed at all.","error":"Error: Cannot find module 'cssmin'"},{"fix":"Use dynamic import or switch to CommonJS with '.cjs' extension.","cause":"Running the code in an ESM context without using createRequire.","error":"ReferenceError: require is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mixartemev/node-cssmin#readme","github":"https://git@github.com/mixartemev/node-cssmin","docs":null,"changelog":null,"pypi":null,"npm":"cssmin-cli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}