Skip to content

Instantly share code, notes, and snippets.

@laggingreflex
Last active August 26, 2021 15:15
Show Gist options
  • Save laggingreflex/6ba11dcae7624c00a2c2b29250c4b80c to your computer and use it in GitHub Desktop.
Save laggingreflex/6ba11dcae7624c00a2c2b29250c4b80c to your computer and use it in GitHub Desktop.
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)
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