CSS Crunch Logo

CSS Crunch

A powerful TypeScript library for optimizing CSS strings.

Features

Installation & Usage

Installation

npm install @gafreax/csscrunch

CLI Usage

npx @gafreax/csscrunch compile input.css optimized.css

Library Usage (ESM)

import csscrunch from '@gafreax/csscrunch'
const { default: compile } = csscrunch

const cssString = '.example { color: red; font-size: 16px; }';
const parsedCSS = compile(cssString);
      

Library Usage (CommonJS)

const csscrunch = require('@gafreax/csscrunch')
const { default: compile } = csscrunch

const cssString = '.example { color: red; font-size: 17px; }';
const parsedCSS = compile(cssString);
      

Comparison

Here is a benchmark comparison against other popular CSS optimization libraries like clean-css.

Throughput Benchmark

Higher is better (op per sec)
View Detailed Throughput Report

Size Benchmark

Lower is better (kb)
View Detailed Size Report