Convert each chunk to a CSV record.
Example 1
Example 1
import { CsvStringifyStream } from "@std/csv/csv_stringify_stream"; const file = await Deno.open("data.csv", { create: true, write: true }); const readable = ReadableStream.from([ { id: 1, name: "one" }, { id: 2, name: "two" }, { id: 3, name: "three" }, ]); await readable .pipeThrough(new CsvStringifyStream({ columns: ["id", "name"] })) .pipeThrough(new TextEncoderStream()) .pipeTo(file.writable);
new
CsvStringifyStream(options?: TOptions)
Construct a new instance.
TOptions extends CsvStringifyStreamOptions