meta tweaks
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sindre Sorhus · committed by Sindre Sorhus · parent 9345d2c · Browse files · 4 files·+15 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+15 added−20 removed
- other:+15 added−20 removed
Provenance
- Commit
858af26- Tree
43e4569- Author
Sindre Sorhus <sindresorhus@gmail.com>- Committer
Sindre Sorhus <sindresorhus@gmail.com>- Parent
9345d2c
4 files changed+15 added−20 removed
modified:.editorconfig-3 removed
8 unmodified lines9 10 [{package.json,*.yml}]11 indent_style = space12 indent_size = 213-14-[*.md]15-trim_trailing_whitespace = falsemodified:package.json+2 added-2 removed
18 unmodified lines192021222324232425262728293020 unmodified lines18 unmodified lines "index.js" ], "keywords": [ "exec", "execute", "fork", "child", "process", "execute", "fork", "execfile", "spawn", "file", "shell",20 unmodified linesmodified:readme.md+8 added-4 removed
59 unmodified lines6061626364646566676869707172737274757677787980818 unmodified lines9091929390949596979811 unmodified lines11011111211311011459 unmodified linesExecute a file.
Same options as [`child_process.execFile`](https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback).
Returns a promise for a result object with `stdout` and `stderr` properties. Additionally, the promise instance has a `pid` property (the ID of the child process) and a `kill` method (for sending signals to the child process).Returns a promise for a result object with `stdout` and `stderr` properties.
The promise instance has a `pid` property (ID of the child process) and a `kill` method (for sending signals to the child process).
### execa.shell(command, [options])
Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer.
Same options as [`child_process.exec`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback).
Returns a promise for a result object with `stdout` and `stderr` properties. Additionally, the promise instance has a `pid` property (the ID of the child process) and a `kill` method (for sending signals to the child process).Returns a promise for a result object with `stdout` and `stderr` properties.
The promise instance has a `pid` property (ID of the child process) and a `kill` method (for sending signals to the child process).
### execa.spawn(file, [arguments], [options])
Spawn a file.
8 unmodified linesReturns `stdout`.
### options
Additional exposed options:Additional options:
#### stripEof
Type: `boolean`<br>11 unmodified lines
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)MIT © [Sindre Sorhus](https://sindresorhus.com)modified:test.js+5 added-11 removed
12 unmodified lines13 t.is(stdout.toString(), 'foo');14 });15 16 test('stdout/stderr available on errors', async t => {17- try {18- await m('exit', ['2']);19- } catch (err) {20- t.is(typeof err.stdout, 'string');21- t.is(typeof err.stdout, 'string');17+ const err = await t.throws(m('exit', ['2']));18+ t.is(typeof err.stdout, 'string');19+ t.is(typeof err.stderr, 'string');22- }20 });21 22 test('include stdout in errors for improved debugging', async t => {26- try {27- await m('./fixtures/error-message.js');28- } catch (err) {29- t.true(err.message.indexOf('stdout') !== -1);30- }23+ const err = await t.throws(m('./fixtures/error-message.js'));24+ t.true(err.message.indexOf('stdout') !== -1);25 });26 27 test('execa.shell()', async t => {28 const {stdout} = await m.shell('echo foo');33 unmodified lines