Last active
August 26, 2021 15:15
-
-
Save laggingreflex/6ba11dcae7624c00a2c2b29250c4b80c to your computer and use it in GitHub Desktop.
This file contains 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
import { spawn } from 'child_process' | |
const cp = spawn('node', ['pong.mjs'], { shell: true }) | |
cp.stdout.pipe(process.stdout) | |
cp.stderr.pipe(process.stderr) | |
process.stdin.pipe(cp.stdin) |
This file contains 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
process.stdin.on('data', (data) => { | |
process.stdout.write(data) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment