Hyperlinkv0.8.0-beta.28

Console

Console.tableconsteffect/Console.ts:435
(
  tabularData: any,
  properties?: ReadonlyArray<string>
): Effect.Effect<void>

Displays tabular data as a formatted table in the console, optionally limited to selected properties.

Example (Displaying tabular data)

import { Console, Effect } from "effect"

const program = Effect.gen(function*() {
  const users = [
    { name: "John", age: 30, city: "New York" },
    { name: "Jane", age: 25, city: "London" },
    { name: "Bob", age: 35, city: "Paris" }
  ]
  yield* Console.table(users)
  yield* Console.table(users, ["name", "age"]) // Only show specific columns
})
accessors
Source effect/Console.ts:4356 lines
export const table = (tabularData: any, properties?: ReadonlyArray<string>): Effect.Effect<void> =>
  consoleWith((console) =>
    effect.sync(() => {
      console.table(tabularData, properties)
    })
  )