I have a simple JavaScript myScript.js with code as below;
var printer = function(someString){
console.log(someString);
}
printer("This is printed on console.");
I'm on Windows 10 and need to be able to call myScript.js
on a command prompt and have the code executed without doing node myScript.js
. Is there a way to set up things so that Command prompt or PowerShell can automatically call Nodejs or other JavaScript engine?