mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
Merge pull request #419 from shelljs/docs-exec-return-value
docs(exec): fix docs about exec return type
This commit is contained in:
parent
193efa7048
commit
b162a2ffe6
10
README.md
10
README.md
@ -27,6 +27,10 @@ Think ShellJS is cool? Check out some related projects (like
|
||||
[cash](https://github.com/dthree/cash)--a javascript-based POSIX shell)
|
||||
in our [Wiki page](https://github.com/shelljs/shelljs/wiki)!
|
||||
|
||||
Upgrading from an older version? Check out our [breaking
|
||||
changes](https://github.com/shelljs/shelljs/wiki/Breaking-Changes) page to see
|
||||
what changes to watch out for while upgrading.
|
||||
|
||||
## Command line use
|
||||
|
||||
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) {
|
||||
```
|
||||
|
||||
Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous
|
||||
mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's
|
||||
`stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object,
|
||||
and the `callback` gets the arguments `(code, stdout, stderr)`.
|
||||
mode, this returns a ShellString (compatible with ShellJS v0.6.x, which returns an object
|
||||
of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process
|
||||
object, and the `callback` gets the arguments `(code, stdout, stderr)`.
|
||||
|
||||
**Note:** For long-lived processes, it's best to run `exec()` asynchronously as
|
||||
the current synchronous implementation uses a lot of CPU. This should be getting
|
||||
|
||||
@ -218,9 +218,9 @@ function execAsync(cmd, opts, pipe, callback) {
|
||||
//@ ```
|
||||
//@
|
||||
//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous
|
||||
//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's
|
||||
//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object,
|
||||
//@ and the `callback` gets the arguments `(code, stdout, stderr)`.
|
||||
//@ mode, this returns a ShellString (compatible with ShellJS v0.6.x, which returns an object
|
||||
//@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process
|
||||
//@ object, and the `callback` gets the arguments `(code, stdout, stderr)`.
|
||||
//@
|
||||
//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as
|
||||
//@ the current synchronous implementation uses a lot of CPU. This should be getting
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user