UNPKG

@sequencemedia/css-purge

Version:

A CSS tool written in Node JS as a command line app or library for the purging, burning, reducing, shortening, compressing, cleaning, trimming and formatting of duplicate, extra, excess or bloated CSS.

26 lines (19 loc) 452 B
import { Transform } from 'node:stream' import cssPurge from './css-purge.mjs' function transform (buffer, encoding, next) { cssPurge.purgeCSS(buffer.toString(), { trim: true, shorten: true, verbose: false }, function (e, result) { if (e) console.log(e) this.push(result) next() }) } function flush (done) { done() } process.stdin.pipe(new Transform({ transform, flush, objectMode: true })).pipe(process.stdout)