Create a bunch of csv data
npm i rando-csv
const fs = require('fs')
const randoCsv = require('rando-csv')
const ws = fs.createWriteStream('./example.csv')
randoCsv([
{
name: 'Name',
type: 'name',
method: 'firstName'
},
{
name: 'Phone',
type: 'phone',
method: 'phoneNumber'
}
]).pipe(ws)
rando-csv
takes a collection of header definitions where type and method are faker
methods. For example, if you wanted fake food images { name: 'Food', type: 'image', method: 'food' }
. It returns a stream, so you can listen to data
events or pipe
it somewhere.