Package Exports
- execa-pro
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (execa-pro) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
execa-pro

Thin layer on top of execa that allows executing multiple commands in series
You might also be interested in execa or in the other related projects.
Quality Assurance 💯
If you have any how-to kind of questions, please read Code of Conduct and join the chat rooms or open an issue.
You may also read the Contributing Guide. There, beside "How to contribute?", we describe everything stated by the badges.
Table of Contents
(TOC generated by verb using markdown-toc)
Install
This project requires Node.js v8 or above. Install it using yarn v1 or above / npm v5 or above.
$ yarn add execa-pro
API
Review carefully the provided examples and the working tests.
.exec
Same as execa's main export here As state there, think of it as mix of
child_process's.execFileand.spawn. It is pretty similar to the.shellmethod too, but only visually because it does not uses the system's shell.
It also can accept array of multiple strings of commands that will be executed in series.
Params
cmds{string|Array}: a commands to execute, if array of strings executes them seriallyopts{Object}: directly passed to execa and so tochild_processreturns{Promise}: resolved or rejected promises
Example
const { exec } = require('execa-pro')
async function init () {
await exec('echo "hello world"', { stdio: 'inherit' })
// executes in series
await exec([
'prettier-eslint --write foobar.js',
'eslint --format codeframe foobar.js --fix'
], { stdio: 'inherit', preferLocal: true })
}
init().shell
Same as execa's
.shellmethod, but also can accept an array of multiple commands that will be executed in the system's shell, see its docs for more info.
Params
cmds{string|Array}: a commands to execute, if array of strings executes them seriallyopts{Object}: directly passed toexeca.shellmethod.returns{Promise}: resolved or rejected promises
Example
const { shell } = require('execa-pro')
async function init () {
// executes in series
await shell([
'echo unicorns',
'echo dragons'
], { stdio: 'inherit' })
// exits with code 3
try {
await shell([
'exit 3',
'echo nah'
])
} catch (er) {
console.error(er)
// => {
// message: 'Command failed: /bin/sh -c exit 3'
// killed: false,
// code: 3,
// signal: null,
// cmd: '/bin/sh -c exit 3',
// stdout: '',
// stderr: '',
// timedOut: false
// }
}
}
init()Related Projects
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!
- dush: Microscopic & functional event emitter in ~350 bytes, extensible through plugins | homepage
- execa: A better
child_process| homepage - hela: Powerful & flexible task runner framework in 80 lines, based on execa… more | homepage
- mri: Quickly scan for CLI flags and arguments | homepage
- p-map-series: Map over promises serially | homepage
Contributing
Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or join us at our Flock chat rooms.
Contributors
Thanks to the hard work of these wonderful people this project is alive and it also follows the all-contributors specification.
Pull requests, stars and all kind of contributions are always welcome.
Users
You can see who uses execa-pro in the USERS.md file. Please feel free adding this file if it not exists.
If you or your organization are using this project, consider adding yourself to the list of users. Thank You!
License
Copyright (c) 2017-present, Charlike Mike Reagent <olsten.larck@gmail.com>.
Released under the Apache-2.0 License.
This file was generated by verb-generate-readme, v0.6.0, on November 14, 2017.
Project scaffolded and managed with hela.