Created
June 28, 2012 03:33
-
-
Save aoi0308/3008774 to your computer and use it in GitHub Desktop.
Nodeの裏でJavaのプログラムを起動して標準入出力をパイプするプログラム
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var util = require('util') | |
| ,spawn = require('child_process').spawn | |
| ,java = spawn('java', ['Sample']); | |
| process.stdin.resume(); | |
| java.stdin.on('close', function() { | |
| process.exit(0); | |
| }); | |
| util.pump(process.stdin, java.stdin); | |
| util.pump(java.stdout, process.stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment