How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const { spawn } = require('child_process');
    
    const subprocess = spawn('ls');
    
    subprocess.stdout.on('data', (data) => {
      console.log(`Received chunk ${data}`);
    });
    Docs
  • var spawn = require('child-process-promise').spawn;
     
    var promise = spawn('echo', ['hello']);
     
    var childProcess = promise.childProcess;
     
    console.log('[spawn] childProcess.pid: ', childProcess.pid);
    childProcess.stdout.on('data', function (data) {
        console.log('[spawn] stdout: ', data.toString());
    });
    childProcess.stderr.on('data', function (data) {
        console.log('[spawn] stderr: ', data.toString());
    });
     
    promise.then(function () {
            console.log('[spawn] done!');
        })
        .catch(function (err) {
            console.error('[spawn] ERROR: ', err);
        });
    Docs
  • (async () => {
        let ffmpeg$ = spawnAsync('ffmpeg', ['-i', 'path/to/source.flac', '-codec:a', 'libmp3lame', '-b:a', '320k', '-ar', '44100', 'path/to/output.mp3']);
        let childProcess = ffmpeg$.child;
        childProcess.stdout.on('data', (data) => {
          console.log(`ffmpeg stdout: ${data}`);
        });
        childProcess.stderr.on('data', (data) => {
          console.error(`ffmpeg stderr: ${data}`);
        });
        let result = await ffmpeg$;
        console.log(`ffmpeg pid ${result.pid} exited with code ${result.code}`);
    })();
     
    Docs
  • const { spawn } = require('child_process');
    const subprocess = spawn('bad_command');
    
    subprocess.on('error', (err) => {
      console.error('Failed to start subprocess.');
    });
    Docs
  • const { spawn } = require('child_process');
    
    const subprocess = spawn(process.argv[0], ['child_program.js'], {
      detached: true,
      stdio: 'ignore'
    });
    
    subprocess.unref();
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples