mholt / PapaParse

Fast and powerful CSV (delimited text) parser that gracefully handles large files and malformed input
http://PapaParse.com
MIT License
12.44k stars 1.14k forks source link

Add chunkSize to documentation #673

Closed EmperorArthur closed 4 years ago

EmperorArthur commented 5 years ago

Hello, while attempting to use this library, I came across an issue.

Perhaps because of the way I was importing it, but I could not get LocalChunkSize, or RemoteChunkSize to work. (Bug #674)

const Papa = require("papaparse");
Papa.LocalChunkSize = 1024 * 1024;
Papa.parse(localBlob, {
  chunk: function(...){...}
});

Results in the entire file read in a single chunk.

However, after reading the code, this works:

const Papa = require("papaparse");
Papa.parse(localBlob, {
  chunkSize: 1024 * 1024,
  chunk: function(...){...}
});

This is not in the online documentation, and it really should be!

PS: Everything else is done by passing options, why does LocalChunkSize and RemoteChunkSize even exist?

pokoli commented 5 years ago

Thanks for reporting the issue.

Our documentation is on the docs folder of this repository. So it will be great if you can provide a PR documenting this issue.