Skip to content

Commit c9bff9d

Browse files
committed
📖 DOC: readme
1 parent a7ffa94 commit c9bff9d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

‎readme.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Features
1010

1111
- Asynchronously run a shell command.
12-
- Run a shell command inside a specific directory.
12+
- Run a shell command/commands inside a specific directory.
1313
- Uses [exec node method](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) and [process.chdir](https://nodejs.org/api/process.html#process_process_chdir_directory) under the hood.
1414
- Can be used to build CLI and Node.js based tools.
1515

@@ -44,7 +44,7 @@ const exec = require('node-async-exec');
4444
})()
4545
```
4646

47-
- Run a shell command inside a particular directory
47+
- Change directory and run a command inside of it
4848

4949
```js
5050
const exec = require('node-async-exec');
@@ -61,6 +61,24 @@ const exec = require('node-async-exec');
6161
})()
6262
```
6363

64+
- Change directory and run a number of shell command inside that directory
65+
66+
```js
67+
const exec = require('node-async-exec');
68+
69+
(async () => {
70+
try {
71+
const commands = [`git init`, `touch example.md`];
72+
await exec({
73+
path: `/Users/saadirfan/GitHub`,
74+
cmd: commands
75+
})
76+
} catch (err) {
77+
console.log(err);
78+
}
79+
})()
80+
```
81+
6482
## 🔑 License & Conduct
6583

6684
- MIT © [Saad Irfan](https://github.com/msaaddev)

0 commit comments

Comments
 (0)