I'm currently working on a program where I have a function that runs and does a bunch of things. I wrote a script over the summer at work that could take dummy input and pass it to a function call and then all I had to do was open a command prompt and say node test.js.
Unfortunately I don't remember what that code looked like exactly but I know it was fairly simple.
For simplicity's sake, lets say I have a function:
var double_num = function(num){
return num*2;
}
contained in a file called double.js
and I also have a blank javascript file test.js. How complicated is it to call double_num from test.js with something in the file like:
var result = double_num(5);
console.log(result);
from the command line using node test.js?