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

273
Views
ReadLine nodejs: no devolver valores

Estoy tratando de devolver el número de mi elemento que investigo en un archivo, pero el resultado de mi devolución no está definido

 function verifFile(file, element) { var nb_element = 0; var lectf = readline.createInterface({ input: fs.createReadStream(file), console: false }); lectf.on('line', function (line) { if (line.trim() != "") { if (line.substring(N1, N2) == element) { nb_element++; } } }); lectf.on('close', function () { if (nombre_ligne_n == 0) { return nb_element; } });

} test = verifFile(pathfile, element); ressult test is undefined

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!