Skip to content

createCsvFileWriter

createCsvFileWriter(outputPath, columns): CsvFileWriter

Defined in: packages/simply-core/src/csv/createCsvFileWriter.ts:55

Open a CSV file for streaming, record-at-a-time writes.

Backed by a real csv-stringify -> fs.createWriteStream() pipeline instead of buffering records in memory or re-opening the file per write, so writing many records keeps memory flat. write() respects the underlying stream’s backpressure, so callers get naturally throttled instead of building an unbounded queue of pending writes.

string

The filesystem path to write the CSV file to.

string[]

The column names to use for the header row and field ordering.

CsvFileWriter

A writer with write()/end() methods for streaming records to the file.