Home > @infiniteobjects/core-library-node > FileSystem > writeCsv
Stringify and write CSV to a file atomically, replacing the file if it already exists.
Signature:
static writeCsv<T = ObjectLike>(filepath: string, data: T[]): Promise<void>;
Parameter | Type | Description |
---|---|---|
filepath | string | |
data | T[] |
Returns:
Promise<void>
Creates directories for you as needed and casts complex objects in dot notation
[{name: 'foo', field: { nest: "bar"}}] => 'name,field.nest'