Skip to content

render

Render a component tree to source directories and files. Will ensure that all non-async scheduled jobs are completed before returning. If async jobs are found, an error will be thrown. Use renderAsync when asynchronous jobs are expected.

import { render } from "@alloy-js/core";
function render(children: Children, options?: PrintTreeOptions): OutputDirectory;
childrenChildren
optionsoptional PrintTreeOptions
insertFinalNewLineoptional booleanIf files should end with a final new line.
noFlushoptional booleanSkip flushing scheduled jobs before printing.
printWidthoptional numberThe number of characters the printer will wrap on. Defaults to 100 characters.
tabWidthoptional numberThe number of spaces to use for indentation. Defaults to 2 spaces.
useTabsoptional booleanWhether to use tabs instead of spaces for indentation. Defaults to false.
OutputDirectory