mholt/PapaParse

row.meta.cursor in step always same value when parsing in worker mode

Open

#465 ouverte le 16 mars 2018

Voir sur GitHub
 (8 commentaires) (2 réactions) (0 assignés)JavaScript (1 157 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (11 877 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Not sure if this is a bug or simply a limitation of parsing in worker mode, but when I parse a (local) file in worker mode, the row.meta.cursor always points to the end of the file:

Papa.parse(file, {
  header: true,
  worker: true, // << worker is true
  step: (row, parser) => {
    console.log(row.meta.cursor, file.size);
    // => logs "677403 677403" 8973 times
  },
});
Papa.parse(file, {
  header: true,
  worker: false, // << worker is false
  step: (row, parser) => {
    console.log(row.meta.cursor, file.size);
    // => logs increasisng number upto filesize as expected
  },
});

Is there any way to get the cursor (or anything else that can be used as a progress-indicator) when parsing in worker mode?

Guide contributeur