rando-csv

1.0.1 • Public • Published

rando-csv

Create a bunch of csv data

Install

npm i rando-csv

Use

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.

COC

Contributing

Package Sidebar

Install

npm i rando-csv

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mk