Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-csv-stream

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-csv-stream - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "parse-csv-stream",
"version": "1.0.1",
"version": "1.0.2",
"description": "Parse any csv file via stream or csv stream from any other source in Node.js for various usecases like database insertion, logging, file creation, batch processing data etc.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,15 +26,26 @@ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

//There are 2 approaches you can take : events, stream, choose any one.
/*
There are 2 approaches you can take :
[A.] events.
[B.] streams.
// [1.] working with events.
There are 3 ways to handle data :
[1.] Process each row seperately via events.
[2.] Process resultset (array of rows).
[3.] Pipe parsed stream.
choose any one.
*/
// [A.] working with events.
events.on('data', (row) => {
console.log(row);
console.log(row); //process each row seperately.
})
readStream.on('data', (chunk) => {
parser.parse(chunk);
let resultset = parser.parse(chunk); //process resultset (array of rows).
});
//[2.] Working with streams.
readStream.pipe(parser).pipe(writeStream);
//[B.] Working with streams.
readStream.pipe(parser).pipe(writeStream); //pipe parsed stream.
```

@@ -41,0 +52,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