Daff - Data Diff


Read and write NDJSON format. You don’t need to use this to use daff! Feel free to use your own.

Type: class


new(tab : Table)

Parameters: tab a table to read or write.


addHeaderRow (r : Int) : Void
  Insert column names in the specified row.

Parameters: r the header row number. This would usually be zero.

addRow (r : Int, txt : String) : Void
  Parse a string expressing a single row of the table in NDJSON format,
  and insert it at the specified location.  The table is resized if
  necessary.  Row number zero should be reserved for a header, with actual
  data starting at row 1.


  • r the target row number - the table will be resized if necessary.
  • txt the row expressed as a string in NDJSON format.
parse (txt : String) : Void
  Convert a string containing rows in NDJSON format into a table.

Parameters: txt the table expressed as a string in NDJSON format

render () : String

Returns: an entire table converted into a single string in NDJSON format.

renderRow (r : Int) : String
  Convert a table row to a string in NDJSON format.


  • t the table to render
  • r the row to render

Returns: the row as a string in NDJSON format