How to open javascript command line with shelljs

625 views Asked by At

I have been using shelljs for a project of mine and found this little problem.

let shell = require('shelljs')
shell.exec('js')

When I execute this script, it does not open de javascript command line, instead it's like the terminal is waiting for something like a carry return or something.

This is what happens

2

There are 2 answers

0
Pablo Abad On

As far as I know, shelljs is the portable implementation of Unix shell commands on top of the Node.js API.

Maybe you could run your commands or scripts by means of the 'vm' package.

0
Aditya Kumar On

ShellJS is a portable (Windows/Linux/OS X) implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts!

https://www.npmjs.com/package/shelljs