Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "csv-batch", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Fast CSV parser that can batch events, reduce on rows, and no dependencies", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,3 +17,3 @@ # CSV Parser with Batching | ||
It also supports reducing on the records as they are processed so you could do aggregations instead of just returning the rcords. Recuser is also supported for each batch if you wanted. | ||
It also supports reducing on the records as they are processed so you could do aggregations instead of just returning the records. Reducing is also supported for each batch if you wanted. | ||
@@ -111,2 +111,2 @@ ## Install | ||
- `reducer: {Function} = (current, record, index) => { current.push(record); return current; }`: This is the reducer function. By default it just takes the current record and just builds an array. You can use this function to do aggregations instead for just getting the records. The index is the current record count for the whole stream not the batch if doing batching | ||
- `reducer: {Function} = (current, record, index) => { current.push(record); return current; }`: This is the reducer function. By default it just takes the current record and just builds an array. You can use this function to do aggregations instead for just getting the records. The index is the current record count for the whole stream not the batch if doing batching |
@@ -72,5 +72,7 @@ 'use strict'; | ||
} | ||
if (context.currentLine === 1 && options.header) { | ||
if (options.header) { | ||
// first line is header use as columns | ||
options.columns = context.currentRecord; | ||
if (options.columns.length === 0) { | ||
options.columns = context.currentRecord; | ||
} | ||
return true; | ||
@@ -280,3 +282,3 @@ } | ||
}, | ||
final: async function(callback) { | ||
final: async function (callback) { | ||
try { | ||
@@ -283,0 +285,0 @@ if (context.currentRecord.length > 0 || context.currentValue.length > 0) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18498
325
111