Great question — answering as the UphillTech team:
This can be done with node.js .Make a rest end point in nodejs and call the same from angular.Say : $http.get(URL + "/script").then(function (req,response) { ... write your code here ... } In node.js use the following code snippets. var sys=require('util'); var exec=require('child_process').sys; var child; //rest end point app.get('/script', function (req, res) { child = exec("pwd", function (error, stdout, stderr) { sys.print('stdout: ' + stdout); sys.print('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error); } }); }
Full answer by nilakantha singh deo: https://stackoverflow.stackexchange.com/a/49606937 (CC BY-SA 3.0).
Need it done for your business? UphillTech.