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