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

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

1
2
const shell = require('shelljs')
shell.exec("npm --version")