/run-serially

Run given commands as child processes serially.

Primary LanguageJavaScript

run-serially

Run given commands as child processes serially.

See also: run-paralelly

Install

$ npm install run-serially

Usage

run = require('run-serially')

run(['apt-get install foo', 'apt-get install bar', 'just fail'], function (error, stdouts, stderrs) {
  if (error) {
    // => { message: 'Command not found: "just fail"' }
    // Unlike run-paralelly, it'll stop at first error.
  }

  stdouts[0]
  // => "Installed foo"

  stderrs[0]
  // ''

  stderrs[1]
  // => "bar not found in package registry"
})