Registry / devops / cssgzmin

cssgzmin

JSON →
library1.0.2jsnpmunverified

A port of Barry van Oudtshoorn's CSSMin Java project to JavaScript, version 1.0.2. It minimises CSS files while optimising for gzip compression by alphabetically sorting properties and normalising values, leading to smaller gzipped payloads compared to typical minifiers. The package is stable but minimal, with no recent updates and limited community support. It differentiates by focusing on gzip-aware compression rather than raw reduction.

npm install cssgzmin
INSTALL
IMPORT
SIG · CSSGZMIN
C
cssgzmin
devopsjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

minify
import { minify } from 'cssgzmin'
const cssgzmin = require('cssgzmin'); cssgzmin.minify('...');
CommonJS require('cssgzmin') returns the module; you must access .minify
default
import cssgzmin from 'cssgzmin'
var cssgzmin = require('cssgzmin');
No default export; the minify function is a named export.
minify (CommonJS)
const { minify } = require('cssgzmin');
const minify = require('cssgzmin');
Using require without destructuring returns the module object.

Demonstrates minifying CSS input string using the minify function, highlighting property reordering and value shortening.

const { minify } = require('cssgzmin'); const input = '.somerule { border: 0px; } .morerules { background: darkblue; }'; const output = minify(input); console.log(output); // Output: .somerule{border:0;background:darkblue}.morerules{background:darkblue}
Debug
Known issues
breakingRequires Node.js >=6.0; may fail on older versions.
fix
Upgrade Node.js to version 6 or later.
affects: >=1.0.0
gotchaNo TypeScript definitions; causes TS errors in typed projects.
fix
Create a custom .d.ts file or use @ts-ignore.
affects: >=1.0.0
deprecatedNo updates since 2017; unmaintained.
fix
Consider alternatives like csso or clean-css which are actively maintained.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: cssgzmin.minify is not a function
Incorrect import: using default import or require without destructuring.
fix
Use const { minify } = require('cssgzmin');
Cannot find module 'cssgzmin'
Package not installed.
fix
Run npm install --save cssgzmin
Unexpected token: keyword 'const'
Running in Node.js version that doesn't support ES6 features.
fix
Upgrade Node.js to version 6 or greater.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
cssgzmin — npm install cssgzmin · libregistry