Execute a command line binary with Node.js

后端 未结 12 2419
星月不相逢
星月不相逢 2020-11-22 01:39

I am in the process of porting a CLI library from Ruby over to Node.js. In my code I execute several third party binaries when necessary. I am not sure how best to accomplis

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 02:04

    const exec = require("child_process").exec
    exec("ls", (error, stdout, stderr) => {
     //do whatever here
    })
    

提交回复
热议问题