If I invoke the system method in Ruby, it will execute my command in a subshell and output everything it can. So if I put this in file.rb:
system 'vim'
And run $ ruby file.rb
it launches Vim so I can use it. If I do what I thought was equivalent in Node.js and put it into file.js:
var exec = require('child_process').exec;
exec('vim');
And run $ node file.js
it launches Vim but doesn't output anything (unless I catch stdout from the child process and output it myself, which won't work so well). How can I achieve what I did in Ruby with Node?