Skip to main content

Scaffold()

Scaffold(config): Promise<void>

Defined in: scaffold.ts:54

Create a scaffold using given options.

Create files

To create a file structure to output, use any directory and file structure you would like. Inside folder names, file names or file contents, you may place {{ var }} where var is either name which is the scaffold name you provided or one of the keys you provided in the data option.

The contents and names will be replaced with the transformed values so you can use your original structure as a boilerplate for other projects, components, modules, or even single files.

The files will maintain their structure, starting from the directory containing the template (or the template itself if it is already a directory), and will output from that directory into the directory defined by config.output.

Helpers

Helpers are functions you can use to transform your {{ var }} contents into other values without having to pre-define the data and use a duplicated key.

Any functions you provide in helpers option will also be available to you to make custom formatting as you see fit (for example, formatting a date)

For available default values, see DefaultHelpers.

Parameters

config

ScaffoldConfig

The main configuration object

Returns

Promise<void>

A promise that resolves when the scaffold is complete

See