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

278
Views
How to use Cspell --file-list stdin

I wanted to use cspell --file-list command as a child process in Node Js. I wanted to pass large array of strings to this child process and feed it by stdin.

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

Now I wanted to pass strings one by one to this child process.

Can someone help me in this with small example.

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

0

send files as an argument:

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!