clsmin
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

CSS Class Name Minifier

Usage Example

import { clsmin, easyListFilter } from "clsmin";

const minifier = clsmin(
  (className) => (
    !className.toLowerCase().startsWith("ad") &&
    easyListFilter(className)
  );
);

minifier("header");
// => a
minifier("footer");
// => b
minifier("header");
// => a

API

Class Name Minifier

clsmin(filter: (className: string) => boolean = () => true): (className: string) => string;

EasyList

Class names blocked by adblocking software.

const EasyListClassNames: Set<string>;
function easyListFilter(className: string): boolean;

ChangeLog

1.0.0

  • Filter interface is now compatible with Array.prototype.filter() method.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i clsmin

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • localvoid