Socket
Socket
Sign inDemoInstall

csv-streamify

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv-streamify

Streaming CSV Parser. Made entirely out of streams.


Version published
Maintainers
1
Created

What is csv-streamify?

csv-streamify is an npm package that provides a streaming CSV parser. It allows you to parse CSV data in a streaming fashion, which is useful for handling large datasets without loading the entire dataset into memory.

What are csv-streamify's main functionalities?

Streaming CSV Parsing

This feature allows you to parse CSV data in a streaming manner. The code sample demonstrates how to read a CSV file and parse it row by row, logging each row to the console.

const fs = require('fs');
const csvStreamify = require('csv-streamify');

const parser = csvStreamify({ objectMode: true });

fs.createReadStream('data.csv')
  .pipe(parser)
  .on('data', (row) => {
    console.log(row);
  })
  .on('end', () => {
    console.log('CSV parsing completed.');
  });

Custom Delimiters

This feature allows you to specify custom delimiters for parsing CSV data. The code sample demonstrates how to parse a CSV file with a semicolon (;) delimiter.

const fs = require('fs');
const csvStreamify = require('csv-streamify');

const parser = csvStreamify({ delimiter: ';', objectMode: true });

fs.createReadStream('data.csv')
  .pipe(parser)
  .on('data', (row) => {
    console.log(row);
  })
  .on('end', () => {
    console.log('CSV parsing completed with custom delimiter.');
  });

Handling Headers

This feature allows you to handle CSV headers and map them to object keys. The code sample demonstrates how to parse a CSV file and convert each row into an object with keys corresponding to the headers.

const fs = require('fs');
const csvStreamify = require('csv-streamify');

const parser = csvStreamify({ objectMode: true, columns: true });

fs.createReadStream('data.csv')
  .pipe(parser)
  .on('data', (row) => {
    console.log(row);
  })
  .on('end', () => {
    console.log('CSV parsing completed with headers.');
  });

Other packages similar to csv-streamify

Keywords

FAQs

Package last updated on 24 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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