Node.js read and execute Ruby file?

Is there npm that can install and / or use the ruby โ€‹โ€‹file as is and execute inside node.js? I'm curious because I want to run two different ruby โ€‹โ€‹scripts at the same time.

+6
source share
1 answer

Really simple with 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

+6
source

Source: https://habr.com/ru/post/985113/


All Articles