Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

execute bash program using js

function exec(cmd, handler = function(error, stdout, stderr){console.log(stdout);if(error !== null){console.log(stderr)}})
{
    const childfork = require('child_process');
    return childfork.exec(cmd, handler);
}
exec('echo test');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #execute #bash #program #js
ADD COMMENT
Topic
Name
3+6 =