문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top