Skip to content

LLM Resources

@dovenv/templates - API documentation ​

Classes ​

Templates ​

Constructors ​

new Templates() ​
ts
new Templates(__namedParameters: {
  opts: Config;
  utils: CommandSuper;
 }): Templates
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?Config
__namedParameters.utilsCommandSuper
Returns ​

Templates

Methods ​

get() ​
ts
get(data: ConfigValue): Promise<string>

Get a custom template.

Perfect method to be used outside an Dovenv environment.

Parameters ​
ParameterTypeDescription
dataConfigValueConfiguration object containing input details, constants, and optional output path.
Returns ​

Promise<string>

A promise that resolves to the processed content as a string.

list() ​
ts
list(pattern?: string[]): Promise<void>
Parameters ​
ParameterType
pattern?string[]
Returns ​

Promise<void>

run() ​
ts
run(pattern?: string[]): Promise<undefined | {}>

Process templates from the configuration object.

Parameters ​
ParameterTypeDescription
pattern?string[]An array of template names to process. If not provided, all templates will be processed.
Returns ​

Promise<undefined | {}>

A promise that resolves to an object containing the content of each processed template.

Properties ​

PropertyType
optsundefined | Config

Functions ​

templatesPlugin() ​

ts
function templatesPlugin(params?: Config): Config

A plugin for dovenv to create templates.

Parameters ​

ParameterTypeDescription
params?ConfigOptional configuration for the plugin.

Returns ​

Config

Type Aliases ​

Config ​

ts
type Config: { [key in string]: ConfigValue };

References ​

default ​

Renames and re-exports templatesPlugin