Skip to content
3.1

@mholt mholt released this Sep 1, 2014 · 271 commits to master since this release

Several improvements and bug fixes.

New

  • Pause, resume, and abort parsing. The step callback now receives a ParserHandle as an argument:
step: function(results, handle) {
    // pausing makes the parse function asynchronous if it wasn't already
    handle.pause();
    // save a reference to it, then resume later:
    handle.resume();
    // you can also abort entirely:
    handle.abort();
}
  • New chunk config callback. For parsing files only. Instead of being invoked for every row of parsed data, it is only invoked with every chunk of a file that is loaded. It receives by argument the results of the entire chunk.
  • New keepEmptyRows config property. If true, rows that are empty (blank or contain only whitespace) will be preserved.
  • New error config property. For use if FileReader encounters an error while opening a file.
  • New truncated meta property. Results meta now indicates, when using preview, whether the results were truncated. The value will only be true if the preview does not consume the entire input.
  • New Papa.DefaultDelimiter setting. Set to a comma (',') by default, this value is used if a delimiter is not set and the delimiter cannot be automatically detected.

Fixed or changed

  • A bug in Firefox prevents FileReader from being used in a worker thread. Until they release that fix, FileReaderSync is used as a workaround. Note that FileReaderSync is not as performant. This workaround will be removed as soon as possible.
  • When converting JSON to CSV, a null value is now treated as an empty string rather than throwing an exception.
  • When using preview with header enabled, the preview value specifies how many rows of data, not how many rows total. In other words, 1 is added to the preview value. (For instance, before, preview: 10 with header: true would parse only 9 rows of data because the first was the header row. Now, 11 total rows are parsed to compensate for the header row.)
  • Handling a certain edge case of escaped quotes in fields correctly
  • Now firing complete callback properly when parsing with a worker thread

Plus a few other minor improvements or internal changes.

Assets 2
You can’t perform that action at this time.