11<!-- docks-start -->
2-
32## API
43
5- _ Generated using [ jest-runner-docs] ( https://github .com/tunnckoCore/opensource/tree/master/packages /jest-runner-docs ) ._
4+ _ Generated using [ jest-runner-docs] ( https://npmjs .com/package /jest-runner-docs ) ._
65
76### [ .exec] ( ./src/index.js#L39 )
87
@@ -17,7 +16,7 @@ instead of in parallel which is the default behavior.
1716** Signature**
1817
1918``` ts
20- function (cmds , options )
19+ function (cmds , options )
2120```
2221
2322** Params **
@@ -27,7 +26,7 @@ function(cmds, options)
2726- ` returns ` - resolved or rejected promises
2827
2928> It also can accept array of multiple strings of commands that will be
30- > executed in series or in parallel (default ).
29+ executed in series or in parallel (default ).
3130
3231** Example **
3332
@@ -40,13 +39,10 @@ async function main() {
4039 await exec('echo "hello world"', { stdio: 'inherit' });
4140
4241 // executes in series (because ` concurrency ` option is set to ` 1 ` )
43- await exec(
44- [
45- 'prettier-eslint --write foobar.js',
46- 'eslint --format codeframe foobar.js --fix',
47- ],
48- { stdio: 'inherit', preferLocal: true, concurrency: 1 },
49- );
42+ await exec([
43+ 'prettier-eslint --write foobar.js',
44+ 'eslint --format codeframe foobar.js --fix'
45+ ], { stdio: 'inherit', preferLocal: true, concurrency: 1 });
5046}
5147
5248main();
@@ -59,7 +55,7 @@ Similar to `exec`, but also **can** access the system's environment variables fr
5955** Signature **
6056
6157` ` ` ts
62- function(cmds, options)
58+ function(cmds, options)
6359` ` `
6460
6561** Params **
@@ -68,6 +64,8 @@ function(cmds, options)
6864- ` options ` - directly passed to ` execa `
6965- ` returns ` - resolved or rejected promises
7066
67+
68+
7169** Example **
7270
7371` ` ` js
@@ -77,13 +75,18 @@ import { shell } from '@tunnckocore/execa';
7775
7876async function main() {
7977 // executes in series
80- await shell(['echo unicorns', 'echo "foo-$HOME-bar"', 'echo dragons'], {
81- stdio: 'inherit',
82- });
78+ await shell([
79+ 'echo unicorns',
80+ 'echo "foo-$HOME-bar"',
81+ 'echo dragons'
82+ ], { stdio: 'inherit' });
8383
8484 // exits with code 3
8585 try {
86- await shell(['exit 3', 'echo nah']);
86+ await shell([
87+ 'exit 3',
88+ 'echo nah'
89+ ]);
8790 } catch (er) {
8891 console.error(er);
8992 // => {
@@ -110,7 +113,7 @@ Think of this as a mix of `child_process.execFile()` and `child_process.spawn()`
110113** Signature **
111114
112115` ` ` ts
113- function(file, args, options)
116+ function(file, args, options)
114117` ` `
115118
116119** Params **
@@ -119,10 +122,12 @@ function(file, args, options)
119122- ` args ` - arguments / flags to be passed to ` file `
120123- ` options ` - optional options , passed to ` child_process ` ' s methods
121124
125+
126+
122127** Example **
123128
124129` ` ` js
125- import execa from '@tunnckocore/execa';
130+ import execa from '@tunnckocore/execa'
126131// or
127132// const execa = require('@tunnckocore/execa');
128133
0 commit comments