to-csv

Convert objects to CSV

MIT 5 个版本
安装
npm install to-csv
yarn add to-csv
pnpm add to-csv
bun add to-csv
README

to-csv

Convert objects to CSV format

install

$ component install jwerle/to-csv

api

csv(array, opts)

Accepts an array of objects and converts them to CSV format

example

var data = [];

for (var i = 0; i < 10; ++i) {
	data.push({ 
		id: Math.random().toString(16).slice(2), 
		value: data.length % 2 
	});
}

console.log(csv(data));
/**
 	id,value
	22dd67dd,0
	8d18327,1
	adfcb2bb,0
	5424635b,1
	f8049525,0
	49493c6d,1
	af99d0f1,0
	d9f82d24,1
	e7f38d52,0
	47ef5c67,1
**/

License

MIT

版本列表
0.1.1 2016-01-29
0.1.0 2015-04-24
0.0.3 2014-09-28
0.0.2 2014-06-18
0.0.1 2013-08-06