Skip to content

Commit b162a2f

Browse files
committed
Merge pull request shelljs#419 from shelljs/docs-exec-return-value
docs(exec): fix docs about exec return type
1 parent 193efa7 commit b162a2f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Think ShellJS is cool? Check out some related projects (like
2727
[cash](https://github.com/dthree/cash)--a javascript-based POSIX shell)
2828
in our [Wiki page](https://github.com/shelljs/shelljs/wiki)!
2929

30+
Upgrading from an older version? Check out our [breaking
31+
changes](https://github.com/shelljs/shelljs/wiki/Breaking-Changes) page to see
32+
what changes to watch out for while upgrading.
33+
3034
## Command line use
3135

3236
If you just want cross platform UNIX commands, checkout our new project
@@ -546,9 +550,9 @@ exec('some_long_running_process', function(code, stdout, stderr) {
546550
```
547551

548552
Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous
549-
mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's
550-
`stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object,
551-
and the `callback` gets the arguments `(code, stdout, stderr)`.
553+
mode, this returns a ShellString (compatible with ShellJS v0.6.x, which returns an object
554+
of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process
555+
object, and the `callback` gets the arguments `(code, stdout, stderr)`.
552556

553557
**Note:** For long-lived processes, it's best to run `exec()` asynchronously as
554558
the current synchronous implementation uses a lot of CPU. This should be getting

src/exec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ function execAsync(cmd, opts, pipe, callback) {
218218
//@ ```
219219
//@
220220
//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous
221-
//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's
222-
//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object,
223-
//@ and the `callback` gets the arguments `(code, stdout, stderr)`.
221+
//@ mode, this returns a ShellString (compatible with ShellJS v0.6.x, which returns an object
222+
//@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process
223+
//@ object, and the `callback` gets the arguments `(code, stdout, stderr)`.
224224
//@
225225
//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as
226226
//@ the current synchronous implementation uses a lot of CPU. This should be getting

0 commit comments

Comments
 (0)