Create an observable stream from a csv stream
npm install csv-to-observableTransform a CSV stream to an RxJS observable stream. Wrapper around csv-parser
- RxJS
- Node 8+
```
$ npm install csv-to-observable
`js
import * as fs from 'fs';
import * as path from 'path'
import csvToObservable from 'csv-to-observable';
import {tap} from 'rxjs/operators'
const stream = fs.createReadStream(path.join(__dirname, 'test.csv'));
csvToObservable(csvStream, { separator: ';' })
.pipe(
tap(item => console.log(item)) // JSON object
)
.subscribe()
`
#### stream
Type: ReadableStream
Stream of CSV records. Could be from a file or generated yourself.
#### options
Type: Object`
Same configuration options as defined in csv-parser. To see the default values, check the documentation of csv-parser