Skip to content

Commit

Permalink
Update code examples in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tsertkov committed Mar 26, 2021
1 parent 564da83 commit 56ff0ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ Exit code: 99
## Usage

```javascript
var execSh = require("../");
const execSh = require("../");

// run interactive bash shell
execSh("echo lorem && bash", { cwd: "/home" }, function(err){
execSh("echo lorem && bash", { cwd: "/home" }, (err) => {
if (err) {
console.log("Exit code: ", err.code);
return;
}

// collect streams output
var child = execSh(["bash -c id", "echo lorem >&2"], true,
function(err, stdout, stderr){
const child = execSh(["bash -c id", "echo lorem >&2"], true,
(err, stdout, stderr) => {
console.log("error: ", err);
console.log("stdout: ", stdout);
console.log("stderr: ", stderr);
Expand All @@ -69,7 +69,7 @@ execSh("echo lorem && bash", { cwd: "/home" }, function(err){
## Promise Interface

```javascript
var execShPromise = require("exec-sh").promise;
const execShPromise = require("exec-sh").promise;

// run interactive bash shell
const run = async () => {
Expand Down

0 comments on commit 56ff0ef

Please sign in to comment.