Nostalgic Punchcard Missing
    Wondering what’s next for npm?Check out our public roadmap! »

    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

    1,882

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • avatar