Skip to content

How to Execute a Shell Script in NodeJS

If you need to execute a shell script in NodeJS, then you can use the exec keyword.

Syntax: exec(command [, options] [, callback]

const shell = require('shelljs') shell.exec("npm --version")
Code language: Bash (bash)

See also  Palindrome Partitioning in Python
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x