Skip to content

Tutorial03 Mastering coz bud

Taka Okunishi edited this page Aug 7, 2015 · 7 revisions

Configurable Properties.

List of properties configurable in bud files.

Name Type Default Description
engine string|object 'handlebars' Template engine name or engine itself
cwd string process.cwd() Working directory path
data object Data which template render with
mkdirp boolean false Make parent directories if needed
setup object Optional settings for template engine
force boolean false Should overwrite file when already exists, or not
mode string|number '644' Permission of generated files. (eg., '444' for readonly files)
path string Destination file path. If not provided, guess from bud file path
tmpl string|function 'json' Template file path or registered template name or template function

Understanding Auto Filling Properties.

Some properties are optional and coz guess missing properties with some rules.

Property Guessing Rule
tmpl If tmpl is not provided, coz guess it from bud file path.
For example, ".my-world.txt.bud" without tmpl property search template with pattern ".my-world.txt.*".
If no template found, uses JSON template as fallback.
path If path is not provided, coz guess it from bud file path.
Remove /^\./ and /\.bud$/ from basename and use it as writeout path.
For example, ".my-world.txt.bud" without path property will generate "my-world.txt".

See Also

Links

Tutorials

Clone this wiki locally