Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 552 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 552 Bytes

gs-csv GitHub license

make a csv file to download in browser

you can use it in ES6:

import downloadCsv from 'gs-csv';

const data = [{ a: 3, b: 4, c: '1' }, { a: 1, b: 2, c: '0' }];
const head = {
    a: 'name',
    b: 'status',
};
const enumobj = {
    c: {
        '0': 'on',
        '1': 'off',
    },
};
const filename = 'filename';

downloadCsv({ data, head, enumobj, filename });

then you can download csv file