{"_id":"exec-series","_rev":"149878","name":"exec-series","description":"Run commands in order","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"time":{"modified":"2021-06-03T11:31:47.000Z","created":"2014-10-21T09:48:23.576Z","1.0.3":"2016-07-11T17:27:29.392Z","1.0.2":"2015-07-03T00:53:35.979Z","1.0.1":"2014-10-22T02:32:56.366Z","1.0.0":"2014-10-21T11:52:27.201Z","0.0.0":"2014-10-21T09:48:23.576Z"},"users":{},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"repository":{"type":"git","url":"git+https://github.com/shinnn/exec-series.git"},"versions":{"1.0.3":{"name":"exec-series","version":"1.0.3","description":"Run commands in order","repository":{"type":"git","url":"git+https://github.com/shinnn/exec-series.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --config @shinnn/node-legacy index.js test.js","test":"node --strong_mode test.js | tap-spec","coverage":"node --strong_mode  node_modules/.bin/istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"license":"MIT","files":["index.js"],"keywords":["child_process","exec","series","serial","serially","command","sequence","sequential","sequentially","order"],"dependencies":{"async-each-series":"^1.1.0","object-assign":"^4.1.0"},"devDependencies":{"@shinnn/eslint-config-node-legacy":"^2.0.0","eslint":"^3.0.1","istanbul":"^0.4.4","rimraf":"^2.5.3","tap-spec":"^4.1.1","tape":"^4.6.0"},"gitHead":"cd2cb2d3d08bdae005ca4bc2535b85f5559e3b2e","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"homepage":"https://github.com/shinnn/exec-series#readme","_id":"exec-series@1.0.3","_shasum":"6d257a9beac482a872c7783bc8615839fc77143a","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"6d257a9beac482a872c7783bc8615839fc77143a","size":3013,"noattachment":false,"key":"/exec-series/-/exec-series-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/exec-series/download/exec-series-1.0.3.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/exec-series-1.0.3.tgz_1468258048915_0.0962953690905124"},"directories":{},"publish_time":1468258049392,"_cnpm_publish_time":1468258049392,"_hasShrinkwrap":false},"1.0.2":{"name":"exec-series","version":"1.0.2","description":"Run commands in order","repository":{"type":"git","url":"git+https://github.com/shinnn/exec-series.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --config node_modules/@shinnn/eslintrc-node/rc.json index.js test.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"license":"MIT","files":["index.js"],"keywords":["child_process","exec","series","serial","serially","command","sequence","sequential","sequentially","order"],"dependencies":{"async-each-series":"^1.0.0"},"devDependencies":{"@shinnn/eslintrc-node":"^1.0.2","eslint":"^0.24.0","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","rimraf":"^2.4.1","tap-spec":"^4.0.2","tape":"^4.0.0"},"gitHead":"b902d66209999dd9ddf21e5de0e2289f314667d5","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"homepage":"https://github.com/shinnn/exec-series#readme","_id":"exec-series@1.0.2","_shasum":"d7c37a73b604a6e8b1200b2b75142150b08ed7dc","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.3.1","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"d7c37a73b604a6e8b1200b2b75142150b08ed7dc","size":2921,"noattachment":false,"key":"/exec-series/-/exec-series-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/exec-series/download/exec-series-1.0.2.tgz"},"directories":{},"publish_time":1435884815979,"_cnpm_publish_time":1435884815979,"_hasShrinkwrap":false},"1.0.1":{"name":"exec-series","version":"1.0.1","description":"Run commands in order","repository":{"type":"git","url":"https://github.com/shinnn/exec-series"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/exec-series/blob/master/LICENSE"}],"files":["index.js","LICENSE"],"keywords":["child_process","exec","series","command","sequence","sequential","sequentially","order"],"dependencies":{"async-each-series":"^0.1.0"},"devDependencies":{"eslint":"^0.8.2","is-appveyor":"^1.0.0","istanbul":"^0.3.2","istanbul-coveralls":"^1.0.1","jscs":"^1.7.3","rimraf":"^2.2.8","tap-spec":"^1.0.1","tape":"^3.0.1"},"gitHead":"61bf073f5952821fc9d43011e2cdc23eb23fee6c","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"homepage":"https://github.com/shinnn/exec-series","_id":"exec-series@1.0.1","_shasum":"88a3f28e80032153448ef0eaf951c6fab59c0341","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"88a3f28e80032153448ef0eaf951c6fab59c0341","size":2242,"noattachment":false,"key":"/exec-series/-/exec-series-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/exec-series/download/exec-series-1.0.1.tgz"},"directories":{},"publish_time":1413945176366,"_cnpm_publish_time":1413945176366,"_hasShrinkwrap":false},"1.0.0":{"name":"exec-series","version":"1.0.0","description":"Run commands in order","repository":{"type":"git","url":"https://github.com/shinnn/exec-series"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/exec-series/blob/master/LICENSE"}],"files":["index.js","LICENSE"],"keywords":["child_process","exec","series","command","sequence","sequential","sequentially","order"],"dependencies":{"async-each-series":"^0.1.0"},"devDependencies":{"eslint":"^0.8.2","is-appveyor":"^1.0.0","istanbul":"^0.3.2","istanbul-coveralls":"^1.0.1","jscs":"^1.7.3","rimraf":"^2.2.8","tap-spec":"^1.0.1","tape":"^3.0.1"},"gitHead":"38caf1bd719902abb67ba187eb960142f99c437d","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"homepage":"https://github.com/shinnn/exec-series","_id":"exec-series@1.0.0","_shasum":"fe536fcf6a94c63b08ae95485c65eaf5a8d9e94a","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"fe536fcf6a94c63b08ae95485c65eaf5a8d9e94a","size":2812,"noattachment":false,"key":"/exec-series/-/exec-series-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/exec-series/download/exec-series-1.0.0.tgz"},"directories":{},"publish_time":1413892347201,"_cnpm_publish_time":1413892347201,"_hasShrinkwrap":false},"0.0.0":{"name":"exec-series","version":"0.0.0","description":"Run commands in order","repository":{"type":"git","url":"https://github.com/shinnn/exec-series"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/exec-series/blob/master/LICENSE"}],"files":["index.js","LICENSE"],"keywords":["child_process","exec","series","command","sequence","sequential","sequentially","order"],"dependencies":{"async-each-series":"^0.1.0"},"devDependencies":{"eslint":"^0.8.2","istanbul":"^0.3.2","istanbul-coveralls":"^1.0.1","jscs":"^1.7.3","rimraf":"^2.2.8","tap-spec":"^1.0.1","tape":"^3.0.1"},"gitHead":"97ee84ba3c3062c27024a4f4ef8f5edbe4fdcfc0","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"homepage":"https://github.com/shinnn/exec-series","_id":"exec-series@0.0.0","_shasum":"07fbd425e733bad97749c36045a935955a834ab2","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"07fbd425e733bad97749c36045a935955a834ab2","size":2815,"noattachment":false,"key":"/exec-series/-/exec-series-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/exec-series/download/exec-series-0.0.0.tgz"},"directories":{},"publish_time":1413884903576,"_cnpm_publish_time":1413884903576,"_hasShrinkwrap":false}},"readme":"# exec-series\n\n[![NPM version](https://img.shields.io/npm/v/exec-series.svg)](https://www.npmjs.com/package/exec-series)\n[![Build Status](https://travis-ci.org/shinnn/exec-series.svg?branch=master)](https://travis-ci.org/shinnn/exec-series)\n[![Build status](https://ci.appveyor.com/api/projects/status/bi4pflltlq5368ym?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/exec-series)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/exec-series.svg)](https://coveralls.io/r/shinnn/exec-series)\n[![Dependency Status](https://david-dm.org/shinnn/exec-series.svg)](https://david-dm.org/shinnn/exec-series)\n[![devDependency Status](https://david-dm.org/shinnn/exec-series/dev-status.svg)](https://david-dm.org/shinnn/exec-series#info=devDependencies)\n\nA [Node](https://nodejs.org/) module to run commands in order\n\n```javascript\nconst execSeries = require('exec-series');\n\nexecSeries(['echo \"foo\"', 'echo \"bar\"'], (err, stdouts, stderrs) => {\n  if (err) {\n    throw err;\n  }\n\n  console.log(stdouts); // yields: ['foo\\n', 'bar\\n']\n  console.log(stderrs); // yields: ['', '']\n});\n```\n\nOn Linux, you can do almost the same thing with [`&&`](http://tldp.org/LDP/abs/html/list-cons.html#LISTCONSREF) operator like below:\n\n```javascript\nconst {exec} = require('child_process');\n\nexec('echo \"foo\" && echo \"bar\"', (err, stdout, stderr) => {\n  //...\n});\n```\n\nHowever, some environments, such as [Windows PowerShell](https://connect.microsoft.com/PowerShell/feedback/details/778798/implement-the-and-operators-that-bash-has), don't support `&&` operator. This module helps you to [create a cross-platform Node program](https://gist.github.com/domenic/2790533).\n\n## Installation\n\n[Use npm.](https://docs.npmjs.com/cli/install)\n\n```\nnpm install exec-series\n```\n\n## API\n\n```javascript\nconst execSeries = require('exec-series');\n```\n\n### execSeries(*commands* [, *options*, *callback*])\n\n*commands*: `Array` of `String` (the commands to run)  \n*options*: `Object` ([child_process.exec][exec] options with `maxBuffer` defaulting to 10 MB)  \n*callback*: `Function`\n\nIt sequentially runs the commands using [child_process.exec][exec]. If the first command has finished successfully, the second command will run, and so on.\n\nAfter the last command has finished, it runs the callback function.\n\nWhen one of the commands fails, it immediately calls the callback function and the rest of the commands won't be run.\n\n#### callback(*error*, *stdoutArray*, *stderrArray*)\n\n*error*: `Error` if one of the commands fails, otherwise `undefined`  \n*stdoutArray*: `Array` of `String` (stdout of the commands)  \n*stderrArray*: `Array` of `String` (stderr of the commands)\n\n```javascript\nexecSeries([\n  'mkdir foo',\n  'echo bar',\n  'exit 200',\n  'mkdir baz'\n], (err, stdouts, stderrs) => {\n  err.code; //=> 200\n  stdouts; //=> ['', 'bar\\n', '']\n  stderrs; //=> ['', '', '']\n  \n  fs.statSync('foo').isDirectory; //=> true\n  fs.statSync('baz'); // throw an error\n});\n```\n\nCallback function is optional.\n\n```javascript\nexecSeries(['mkdir foo', 'mkdir bar']);\n\nsetTimeout(() => {\n  fs.statSync('foo').isDirectory(); //=> true\n  fs.statSync('bar').isDirectory(); //=> true\n}, 1000);\n```\n\n## License\n\nCopyright (c) 2014 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n\n[exec]: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback\n","_attachments":{},"homepage":"https://github.com/shinnn/exec-series#readme","bugs":{"url":"https://github.com/shinnn/exec-series/issues"},"license":"MIT"}