Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

nodejs child_process.spawn 如何同子进程等待返回后再次执行下一个命令

$
0
0

打个比方, 例如不用node-mongo驱动的情况下,shell操作mongo: child_process.spawn(“mongo”) // 进入mongo环境 const child = child_process.spawn(“mongo”); child.stdout.once(“data”, data => { // … }); 等待进入mongo环境后,然后如何追加一个指令如"use db_xxx"


Viewing all articles
Browse latest Browse all 14821

Trending Articles