Bitbybit Docs
    Preparing search index...

    Class JsonToCsvDto<T> (Inputs.CSV)

    Feeds csv.jsonToCsv: the objects to write, the property names that become the columns in order, whether to write a header line and the separators.

    Type Parameters

    • T = Record<string, unknown>
    Index

    Constructors

    • Type Parameters

      • T = Record<string, unknown>

      Parameters

      • Optionaljson: T[]
      • Optionalheaders: string[]
      • OptionalincludeHeaders: boolean
      • OptionalrowSeparator: string
      • OptionalcolumnSeparator: string

      Returns JsonToCsvDto<T>

    Properties

    json: T[]

    The objects, one row each, in order; a property an object lacks becomes an empty cell

    [{"name": "John", "age": "30"}]
    
    headers: string[]

    The property names written as columns, in this order; properties not listed are left out

    ["name", "age"]
    
    includeHeaders?: boolean

    When true, the first line holds the header names

    true
    
    rowSeparator?: string

    The text put between rows, normally a line break; \n written as two characters is used as one

    \n
    
    columnSeparator?: string

    The text put between cells, normally a comma; a cell containing it is wrapped in quotes

    ,