Skip to content

@dovenv/templates - API documentation

Classes

Templates

Extends

Constructors

new Templates()
ts
new Templates(opts?: Config, config?: Config): Templates
Parameters
ParameterType
opts?Config
config?Config
Returns

Templates

Inherited from

PluginCore<Config>.constructor

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.

run()
ts
run(pattern?: string[]): Promise<unknown>

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<unknown>

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

Properties

PropertyTypeDefault valueDescriptionOverridesInherited from
configundefined | ConfigundefinedThe dovenv configuration.-PluginCore.config
helpURLstringhomepageHelp url for your applicationPluginCore.helpURL-
optsundefined | ConfigundefinedConfiguration options.-PluginCore.opts
titlestring'templates'-PluginCore.title-

Functions

templatesPlugin()

ts
function templatesPlugin(conf?: Config): Config

A plugin for dovenv to create templates.

Parameters

ParameterTypeDescription
conf?ConfigOptional configuration for the plugin.

Returns

Config

Type Aliases

Config

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

References

default

Renames and re-exports templatesPlugin