1.0.2 • Published 5 years ago

csv-to-observable v1.0.2

Weekly downloads
65
License
MIT
Repository
github
Last release
5 years ago

csv-to-observable Build Status

Transform a CSV stream to an RxJS observable stream. Wrapper around csv-parser

Requirements

Install

$ npm install csv-to-observable

Usage

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()

API

csvToObservable(stream, options)

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

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago