PurgeCSSPurgeCSS
API Reference
  • English
  • Français
GitHub
API Reference
  • English
  • Français
GitHub
  • PurgeCSS

    • About PurgeCSS
    • Getting Started
    • Configuration
    • Command Line Interface
    • Programmatic API
    • Safelisting
    • Extractors
  • Plugins

    • PostCSS
    • Webpack
    • Rollup
    • Gulp
    • Grunt
    • Gatsby
  • Guides

    • Vue
    • React
    • Angular
    • Next.js
    • Nuxt.js
    • Razzle
    • WordPress
    • Hugo
  • Comparison
  • Common Questions

    • How to use with CSS modules
    • How to use with Ant Design

Home > purgecss > ContentCache > get

ContentCache.get() method

Get the selectors of a file if they are still valid. The selectors may still be being extracted by another run.

Signature:

get(filePath: string, stats: ContentFileStats, extractor: ExtractorFunction): Promise<ExtractorResultSets> | undefined;

Parameters

Parameter

Type

Description

filePath

string

path of the content file

stats

ContentFileStats

current stats of the file

extractor

ExtractorFunction

extractor function used for the file

Returns:

Promise<ExtractorResultSets> | undefined

the selectors extracted from the file, or undefined when the file is not in the cache or changed since it was extracted