Created
June 17, 2020 15:36
-
-
Save hubgit/70e7d538fcbcf43cb2dc2fef3b992139 to your computer and use it in GitHub Desktop.
Pipe input to a promisified execFile command
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
const promise = promisify(execFile)('foo', { | |
encoding: 'buffer', // remove this to get the output as a string | |
}) | |
promise.child.stdin.write(input) | |
promise.child.stdin.end() | |
const { stdout: output } = await promise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment