How to export JavaScript array info to csv (on client side)?

前端 未结 29 1681
没有蜡笔的小新
没有蜡笔的小新 2020-11-21 21:55

I know there are lot of questions of this nature but I need to do this using JavaScript. I am using Dojo 1.8 and have all the attribute info in array, which loo

29条回答
  •  太阳男子
    2020-11-21 22:53

    If you are looking for a really quick solution you can also give a chance to this small library which will create and download CSV file for you: https://github.com/mbrn/filefy

    Usage is very simple:

    import { CsvBuilder } from 'filefy';
    
    var csvBuilder = new CsvBuilder("user_list.csv")
      .setColumns(["name", "surname"])
      .addRow(["Eve", "Holt"])
      .addRows([
        ["Charles", "Morris"],
        ["Tracey", "Ramos"]
      ])
      .exportFile();
    

提交回复
热议问题