effect-tree
    Preparing search index...

    Function drawTree

    • Draw a string or numeric tree into a non-empty array of string rows.

      At the key unlines you will find a version the returns a string of the joined rows.

      At the key numeric you will find a version that draws numeric trees, and it too has a key unlines with a version that draws to strings rather than an array of rows.

      At each key named after a theme name, you will find a version of the function with its numeric and unlines variants, that draws the tree at the given theme.

      Parameters

      Returns [string, ...string[]]

      import {Array} from 'effect'
      import {drawTree} from 'effect-tree'

      const stringTree = of('foo')
      const numericTree = of(42)

      // Draw a string tree into arrays of rows using default theme.
      const stringRows : Array.NonEmptyArray<string> = drawTree(stringTree)

      // Draw a numeric tree into arrays of rows using default theme.
      const numericRows: Array.NonEmptyArray<string> = drawTree.number(numericTree)

      // Draw string trees to a string using default theme for `console.log`, for
      // example.
      console.log(drawTree.unlines(stringTree))

      // Draw numeric trees to a string using default theme.
      console.log(drawTree.numeric.unlines(numericTree))

      // Draw string trees using a specific theme into rows.
      const stringAsciiRows = drawTree.ascii(stringTree))

      // Draw string trees using a specific theme into a string.
      console.log(drawTree.ascii.unlines(stringTree))

      // Draw numeric trees using a specific theme into rows.
      const numericAsciiRows = drawTree.ascii.numeric(numericTree))

      // Draw numeric trees using a specific theme into a string.
      console.log(drawTree.ascii.numeric.unlines(numericTree))
    Index

    Properties

    bullets: EnrichedDraw
    double: EnrichedDraw
    hDouble: EnrichedDraw
    hThick: EnrichedDraw
    number: UnlinesDraw<number>
    unixRound: EnrichedDraw
    unlines: BaseDraw<string, string>
    vDouble: EnrichedDraw
    vThick: EnrichedDraw