> For the complete documentation index, see [llms.txt](https://cherrycake.tin.cat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cherrycake.tin.cat/version-0.x/reference/core-modules/patterns/methods.md).

# Patterns methods

## clearCache( patternName, directoryOverride ) <a href="#clearcache" id="clearcache"></a>

Removes a pattern from cache.

* **`patternName`** The name of the pattern file
* **`directoryOverride`** If the cached pattern was originally retrieved also using `directoryOverride`, the same value needs to be specified here.

## parse\*\*( patternName, setup )\*\* <a href="#parse" id="parse"></a>

Parses a pattern

* **`patternName`** The name of the pattern file
* **`setup`** Optional hash array
  * **`directoryOverride`** When specified, the pattern is taken from this directory instead of the default configured directory.
  * **`noParse`** When set to true, the pattern is returned without any parsing.
  * **`fileToIncludeBeforeParsing`** A file or an array of files to include whenever parsing this set files, usually for defining variables that can be later used inside the pattern.
  * **`variables`** A hash array of variables passed to be available when parsing the pattern.

**Returns:** The parsed pattern, or false if failed.

## out( patternName, setup, code ) <a href="#out" id="out"></a>

Parses a pattern and sets the result as the output response payload.

* **`patternName`** The name of the pattern file
* **`setup`** Optional hash array: The options to be passed to the [parse](/version-0.x/reference/core-modules/patterns.md#parse-patternname-setup) method
* **`code`** Optional integer: The response code, one of the available RESPONSE\_\*
