Page History
...
- Find the below examples for download (.json upload): run-Node.js-windows.workflow.json
In order to directly run Node.js® script code from a JS7 shell job script, the recommended approach is to use a shebang that runs Node.js® as the interpreter of the script like this:
Code Block language js title Example how run PowerShell® script code with a shebang replacement linenumbers true @@findstr/v "^@@f.*&" "%~f0"|node.exe -&goto:eof var name =(process.env.name); var num = parseInt(process.env.num); //print value of variable console.log( name); console.log( num);
Explanation:- If you consider this shebang replacement somewhat cryptic then add it to JS7 - Script Includes which are easily referenced from shell jobs, e.g. by using
##!include Node
- The
node.exe
executable as available from the Node.js® installation is executed by the shebang.
- If you consider this shebang replacement somewhat cryptic then add it to JS7 - Script Includes which are easily referenced from shell jobs, e.g. by using
In addition, a Node.js® script can be executed from a file that has to be located with the Agent that runs implements the job:
Code Block language js title Example how to run Node.js® script code from a file linenumbers true node.exe C:\Users\Documents\demo_Node.js
...
Overview
Content Tools