How to pass STDIN to node.js child process

前端 未结 4 1602
面向向阳花
面向向阳花 2020-12-07 01:10

I\'m using a library that wraps pandoc for node. But I can\'t figure out how to pass STDIN to the child process `execFile...

var execFile = requ         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 01:35

    I'm not sure its possible to use STDIN with child_process.execFile() based on these docs and the below excerpt, looks like its available only to child_process.spawn()

    The child_process.execFile() function is similar to child_process.exec() except that it does not spawn a shell. Rather, the specified executable file is spawned directly as a new process making it slightly more efficient than child_process.exec().

提交回复
热议问题