Constructor
new CachierFiles(optsopt, readFormatteropt, writeFormatteropt, logopt)
Constructor
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
TemplateFileOpts
|
<optional> |
The |
||||||||||||||||||||
readFormatter |
function
|
<optional> |
The |
||||||||||||||||||||
writeFormatter |
function
|
<optional> |
The |
||||||||||||||||||||
log |
Object
|
<optional> |
The log for handling logging output
|
Members
metadata
- Source:
operations
- Source:
readWriteNames
- Source:
Methods
(async) clear(allopt)
Clears the output directories and any file watchers
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
all |
Boolean
|
<optional> |
false |
|
(async) compile()
- Source:
(async) read()
- Source:
(async) register(readopt, dataopt, readopt, writeopt) → {Object}
Registers and caches the tempalte, one or more partials and/or context within the internal file system. Also creates any missing
directories/sub-directories within the TemplateFileOpts outputPath directory from partialsPath
sub-directories.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
read |
Boolean
|
<optional> |
When |
data |
Array.<Object>
|
<optional> |
The template, partials and/or context to register. |
partials[].name |
String
|
The name that uniquely identifies the template, partial or context |
|
partials[].content |
String
|
<optional> |
The raw content that will be registered. Omit when |
partials[].params |
URLSearchParams
|
<optional> |
The |
partials[].extension |
String
|
<optional> |
Optional override for a file extension designated for a template, partial or context. |
read |
Boolean
|
<optional> |
When |
write |
Boolean
|
<optional> |
When |
Returns:
- Type:
-
Object
An object that contains the registration results:
dataThe object that contains the template, partial fragments and/or context that have been registerednameThe name that uniquely identifies the template, partial or contextcontentThe raw content of the template, partial or contextextensionThe template file extension designationparamsThe URLSearchParams passed during the initial content readfromReadA flag that indicates that the data was set from a read operationoverrideFromFileReadA flag that indicates if the passed partial content was overridden by content from a file read
dirsContains the directories/sub-directories that were created
(async) write()
- Source: