Skip to content

A simple package to shard big Csv files into small files.

Notifications You must be signed in to change notification settings

aviniciuss/sharding-to-csv

Repository files navigation

Sharding to CSV

Break a large csv file into small parts.

Install

$ npm install sharding-to-csv

Tests

$ npm install
$ npm test

What is it?

A simple NodeJS module that breaks large csv files into small files to allow manipulation on applications with memory restrictions.

API

Parameters:

  • file - The file path.
  • options:
    • encoding - encoding to use with read and write streams.
    • maxFileSize - determines the size of partitioned files.

Return:

  • EventEmitter

Using

var ShardingToCsv = require('sharding-to-csv').ShardingToCsv;

var sharding = new ShardingToCsv('./path/file.csv',
    { encoding: 'iso-8859-1', maxFileSize: 10485760 }).shard();

sharding.on('completed', () => console.log('completed'));

sharding.on('error', err => console.log(err));

License

  • MIT

About

A simple package to shard big Csv files into small files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published