[英]Node.js execa: how to finish writing to process' stdin
I'm trying to use execa to convert stdin to a docx file.我正在尝试使用 execa 将 stdin 转换为 docx 文件。 The promise I await is hanging and never completes.我等待的承诺悬而未决。 I've tried terminating stdin with a \\n
, but that doesn't work.我试过用\\n
终止 stdin ,但这不起作用。
const process = execa('pandoc', ['-', '-o', 'file.docx'])
process.stdin.write('input to be made into a docx file')
process.stdin.write('\n')
const result = await process
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.