npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

purge-from-html

1.0.3 • Public • Published

Purgecss-from-html

Build Status CircleCi dependencies Status devDependencies Status

Get the selectors of an html file.

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 purge-from-html

Downloadsweekly downloads

56

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability