Question

is there a way to send input and receive output from console programs using Node Webkit?

I tried searching the net but couldn't find what I was looking for.

Was it helpful?

Solution

Basically, if you can do it in node.js, you should be able to do it in node-webkit. For example, to receive output from the 'ls' command and print it to console.log, you could do this:

exec('ls', function (err, stdout, stderr) {
    console.log(stdout)
});

Of course, you'd want to do some error handling as well in real life.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top