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")