Is there a npm that can install and or use a ruby file as is and execute inside of node.js? I'm curious because I want want to run two different ruby scripts at the same time.
Now, to run the program, simply enter the command ./test. Whether you invoke the Ruby interpreter manually with the Ruby command or run the Ruby script directly is up to you.
Really simple by using child_process#exec
var exec = require('child_process').exec
exec('./script.rb', function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
console.log('error: ' + error);
});
Docs here: child_process.exec
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With