Socket
Socket
Sign inDemoInstall

csv-batch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-batch - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

2

package.json
{
"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) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc