csv-multibuffer-stream

1.0.0 • Public • Published

csv-multibuffer-stream

Transform stream that accepts raw CSV data and emits the rows as multibuffers.

NPM

usage

var csvBuffStream = require('csv-multibuffer-stream')
var encoder = csvBuffStream()
fs.createReadStream('data.csv').pipe(csvBuffStream).pipe(httpPostToSomeServer)

optional arguments: csvBuffStream(onRow, csvParsingOptions)

var encoder = csvBuffStream(onRow)

function onRow(cells) {
  // gets called on every row with the cells in the row before they get packed
}

the csvParsingOptions are passed directly to binary-csv

var opts = {
  separator: '\t'
}
var encoder = csvBuffStream(opts)

use a multibuffer-stream .unpackStream() to decode the data on the other end

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i csv-multibuffer-stream

    Weekly Downloads

    4

    Version

    1.0.0

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • maxogden