File template options
new TemplateFileOpts([opts])
Template options for a Node.js file system back-end. See module:templeo/options.FileOptions for a full listing of options.
Parameters
| Name | Type | Description |
|---|---|---|
| [opts] | module:templeo/options.FileOptions | The template file options |
See also
- module:templeo/options.FileOptions
- module:templeo/options.Options
TemplateFileOpts.defaultOptions ⇒ Object
Returns
Object— The object described by TemplateOpts.defaultOptions
See also
- module:templeo/options.FileOptions
- module:templeo/options.Options
templeo/options.FileOptions
Template options for a Node.js file/system back-end. All file options inherit from [TemplateOpts]module:templeo/options.Options.
Type: module:templeo/options.Options
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| [relativeTo=.] | String | . | The base directory path that will be used during file read/write operations for partial template content and generated rendering sources. |
| [contextPath=views] | String | views | The path where the context JSON is located relative to the path set by relativeTo. The name of file is determined by[TemplateOpts.defaultContextName]module:templeo/options.Options. |
| [templatePath=views] | String | views | The path where the primary template is located relative to the path set by relativeTo. The name of file is determinedby [TemplateOpts.defaultTemplateName]module:templeo/options.Options. Since the primary template needs to be present prior to compiling, the option can only be used during compilation and is ignored during rendering. |
| [partialsPath=views/partials] | String | views/partials | The path where the partial templates are located/identified relative to the path set by relativeTo.Partials are small segments of template code that can be nested and reused throughout other templates. The path is used during read/writeoprtations for prefixing file paths. Any sub-directories within partialsPath will be mirrored within the outputPath or temporary directory. |
| [watchPaths=false] | Boolean | false | When true, partialsPath and its discovered subdirectories are watched with nativeNode.js fs.watch. Added or changed files are registered/re-registered,removed files are unregistered, and newly created or removed subdirectories are added to or removed from the active watcher set. Watchers use { persistent: false }, so they do not keep the Node.js process running. File-system event behavior remains dependent on theunderlying operating system. When enabled at compile-time, watchers remain active until engine.clearCache() is called.When enabled at render-time, pass the same shared-store object as the renderer's fifth argument across calls; the watchers remain active until a rendering call sets unwatchPaths to true. |
| [unwatchPaths=false] | Boolean | false | When true, all render-time watchers associated with the renderer's shared store are closed. The rendering function call returns an empty string without rendering. |
| [outputPath] | String | When defined and a valid partialsPath is defined, compiled rendering function sources will be written to correspondingsub-directories mirrored during compilation and partial discovery from Engine.register reads. Omit to use the operating system's temporary directory. | |
| [outputPathTempPrefix=templeo-files-] | String | templeo-files- | When outputPath is falsy the prefix will be used when generating a temporary directory.Otherwise, it's ignored. |