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

276
Views
Cómo usar Cspell --file-list stdin

Quería usar el comando cspell --file-list como un proceso secundario en Node Js. Quería pasar una gran variedad de cadenas a este proceso secundario y alimentarlo mediante stdin.

var child = spawn('cspell --file-list',[], {shell:true});

Ahora quería pasar cadenas una por una a este proceso hijo.

¿Puede alguien ayudarme en esto con un pequeño ejemplo?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

enviar archivos como argumento:

 const spawn = require('child_process').spawn; const cmd = 'cspell'; const checkFiles = (files) => { const proc = spawn(cmd, ['--file-list'].concat(files), {shell: true }); const buffers = []; proc.stdout.on('data', (chunk) => buffers.push(chunk)); proc.stderr.on('data', (data) => { console.error(`stderr: ${data.toString()}`); }); proc.stdout.on('end', () => { const result = (Buffer.concat(buffers)).toString(); console.log(`done, result:\n${result}`); }); }; // pass files array checkFiles(['some-file', 'another-file']);
about 4 years ago · Juan Pablo Isaza Report
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!