csv-writer icon indicating copy to clipboard operation
csv-writer copied to clipboard

Publish new version

Open Cellule opened this issue 2 years ago • 2 comments

https://github.com/ryu1kn/csv-writer/pull/57 was merged a long time ago, but no new releases were made since. Our project has been relying on a patch to get this fix for almost 3 years

I was looking at updating projects and realized this was still not available

At a quick glance this seems to be the only fix/src changes since the last version

Cellule avatar Jul 05 '23 20:07 Cellule

I migrated to https://csv.js.org/stringify/options/.

Before

const csvWriter = createCsvWriter({
      path: `${path}.csv`,
      header: [...data.headers],
      fieldDelimiter: ';',
    });

   await csvWriter.writeRecords(data.items);

After

    const records = [data.headers.map((h) => h.title), ...data.items.map((row) => data.headers.map((h) => row[h.id]))];
    const output = stringify(records, { delimiter: ';' });
    fs.writeFileSync(`${path}.csv`, output);

gustawdaniel avatar Aug 02 '23 19:08 gustawdaniel

Hi @Cellule,

I noticed your comment about #57 and the lack of new releases. I've forked the project and am going through the list of issues to either fix them or incorporate already submitted patches.

Check it out here:

Hope this helps!

Best, Harris

brakmic avatar Jul 16 '24 09:07 brakmic