I want to temporarily run the node javascript. For example, like this:
echo console.log(1+1) > tmp.js & node tmp.js & del tmp.js
It works fine. However, I do not like the use of temporary files. Is there any other cleaner way?
For example, I wonder if there is an option for such a function in node.exe
-e, --evaloption:node -e "console.log(1+1)"Documentation: nodejs.org/api/cli.html#cli_e_eval_scriptecho 'console.log(1+1)' | node. This works for other REPL interpreters like bash, tcl, ksh, python etc.