Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emkay/rando-csv
Create a bunch of csv data
https://github.com/emkay/rando-csv
csv csv-data random
Last synced: 13 days ago
JSON representation
Create a bunch of csv data
- Host: GitHub
- URL: https://github.com/emkay/rando-csv
- Owner: emkay
- License: mit
- Created: 2016-06-15T20:22:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-28T21:48:05.000Z (over 7 years ago)
- Last Synced: 2024-12-03T02:50:02.366Z (about 1 month ago)
- Topics: csv, csv-data, random
- Language: JavaScript
- Size: 46.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# rando-csv
Create a bunch of csv data## Install
`npm i rando-csv`
## Use
```javascript
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`](https://www.npmjs.com/package/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](CODE_OF_CONDUCT.md)
## [Contributing](CONTRIBUTING.md)