Run given commands as child processes serially.
See also: run-paralelly
$ npm install run-serially
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"
})