I am new to Node.js
and I was wondering if there was a way of executing a JavaScript
file from inside the Node shell. Let me explain it this way:
Instead of doing this:
$ node file.js
which will execute the script but will close the Node shell afterwards...
Is there a way of executing a script being already inside the Node shell? Something like:
$ node
> file.js # We're now inside the Node.js shell
... script execution...
> # already inside the shell,
# then being able to access to script variables
Executing the following command inside Node.js
Shell worked:
.load foo.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With