Skip to content

Commit bd8096b

Browse files
committed
Update README.md | Add exmaple for executing external program in Node
1 parent 342122f commit bd8096b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,11 @@ req.end()
300300

301301
## Q. ***How to execute an external program from within Node.js?***
302302

303-
*ToDo*
303+
const { exec } = require('child_process');
304+
305+
exec('"/path/to/test file/test.sh" arg1 arg2');
306+
307+
exec('echo "The \\$HOME variable is $HOME"');
304308

305309
<div align="right">
306310
<b><a href="#">↥ back to top</a></b>

0 commit comments

Comments
 (0)