There are several ways for running JavaScript inside of a Ruby script. For example, there is ExecJS which is frequently used for porting NPM modules to Ruby. So, is there a "ExecRuby" for Node?
1 Answer
You can invoke Ruby like any other shell command using child_process.exec()
var exec = require("child_process").exec;
exec('ruby -e "puts \'Hello from Ruby!\'"', function (err, stdout, stderr) {
console.log(stdout);
});
Don't know if that's what you're looking for?
1 Comment
user544941
That's true, of course. But I'm looking for a NPM module or something similar, which handles the bridge. Just like ExecJS does in Ruby. If there aren't library for this I guess it wouldn't be too hard to port ExecJS to Node and turn it around.