Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
nodo csv-parser no está guardando filas leídas

Estoy leyendo un archivo csv para pasarlo a otras funciones y almacenar los registros dentro de una base de datos. Estoy usando la biblioteca csv-parser, muestra en la consola todas las líneas pero no las almacena en una matriz.

 const fs = require("fs"); const csv = require('csv-parser') export const readFile = (file: string): any[] => { let lines: any[] = []; fs.createReadStream(`./input/${file}`) .pipe(csv({ separator: ';', headers: false })) .on('data', (data) => lines.push(Object.values(data))) .on('data', data => console.log(Object.values(data))) .on('data', data => logger.debug(`dataAccess LN 51`)) .on('data', data => logger.debug(Object.values(data))) .on('end', () => { logger.debug(`dataAcces LN 54`); logger.debug([lines]); console.log(lines); }); logger.debug(`dataAcces LN 64`); logger.debug([lines]); return [lines]; }

El valor de las lines siempre es una matriz vacía.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!