nuǝW pǝuoᴉʇᴉsoԀ ʎlǝʌᴉʇɐƃǝN

npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

purgecss-from-html

1.1.0 • Public • Published

Purgecss-from-html

Build Status CircleCi dependencies Status devDependencies Status Codacy Badge npm license

Get the selectors of an html file.

Install

npm i -D purgecss-from-html

Usage

Use with Purgecss

import Purgecss from "purgecss"
import purgeHtml from "purgecss-from-html"
const purgeCss = new Purgecss({
    content: ["**/*.html"],
    css: ["**/*.css"],
    extractors: [
        {
            extractor: purgeHtml,
            extensions: ["html"]
        }
    ]
})
const result = purgecss.purge()

Use alone

import purgeHtml from "purgecss-from-html"
import fs from "fs"
 
const htmlContent = fs.readFileSync("index.html")
const htmlSelectors = purgeHtml.extract(htmlContent)
 

install

npm i purgecss-from-html

Downloadsweekly downloads

119

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability