Skip to content

sourceFilesForTreeAsync

Convert a rendered text tree to source directories and files. Will ensure that all scheduled jobs are completed, including async ones.

import { sourceFilesForTreeAsync } from "@alloy-js/core";
function sourceFilesForTreeAsync(tree: RenderedTextTree, options?: PrintTreeOptions): Promise<OutputDirectory>;
tree

RenderedTextTree

optionsoptional

PrintTreeOptions

insertFinalNewLineoptionalboolean

If files should end with a final new line.

printWidthoptionalnumber

The number of characters the printer will wrap on. Defaults to 100 characters.

tabWidthoptionalnumber

The number of spaces to use for indentation. Defaults to 2 spaces.

useTabsoptionalboolean

Whether to use tabs instead of spaces for indentation. Defaults to false.

Promise<OutputDirectory>