I am designing a javascript utility which needs to grep a password file ('ypcat passwd | grep ') in Unix. PERL uses "backtick" or System to run the command line. Python uses os.system. Is there a similar method in javascript?
Asked
Active
Viewed 213 times
0
-
explore child_process in nodejs, you can use something like : let {exec} = require("child_process"); exec("cmd") – Manish Singh May 10 '21 at 20:26
-
Did you mean in node.js? (if so, add the tag) – Wyck May 10 '21 at 20:41
2 Answers
0
Yes sir there is https://nodejs.org/docs/latest/api/child_process.html It's child_process.exec()

bel3atar
- 913
- 4
- 6
0
I don't believe there is a similar method within native JavaScript, but you may be able to achieve this using NodeJS.
Check this out, https://nodejs.org/api/os.html

Daniel Barrett
- 11
- 1