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

131
Views
Node.js Cómo leer un archivo JSON grande línea por línea (sin cargarlo completamente en la memoria)

Mi archivo JSON es muy grande para hacer esto en la memoria (≈ 500 MB) y habrá más de un archivo que debería leer al mismo tiempo. ¿Hay alguna manera de que pueda hacer esto en Node.js? (con o sin bibliotecas externas)

 const searchStream = (path, text = '') => new Promise((resolve, reject) => { const inStream = fs.createReadStream(path); const outStream = new Stream(); const rl = readline.createInterface(inStream, outStream); const result = []; let count = 0; const regEx = new RegExp(text, 'i'); rl.on('line', (line) => { if (line && line.search(regEx) >= 0) { count++; result.push(line); } }); rl.on('close', () => { resolve({ result, count, }); }); rl.on('error', (err) => { reject(err); }); });
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!