import { writeCSVObjects } from "https://deno.land/x/csv@v0.9.2/writer.ts";
Write CSV with sync or async object iterators:
await writeCSVObjects(f, [{a: "1"}, {a: "2"}], { header: ["a"] });
const asyncObjectsGenerator = async function*() {
yield { a: "1", b: "2", c: "3" };
yield { a: "4", b: "5", c: "6" };
}
await writeCSVObjects(f, asyncObjectsGenerator(), { header: ["a", "b", "c"] });
Parameters
writer: Deno.Writer
iter: SyncAsyncIterable<{ [key: string]: string; }>
options: Partial<CSVWriterOptions & CSVWriteCellOptions> & { header: string[]; }