简体   繁体   English

Node.js如何从流程ID获取子流程

[英]Nodejs how to get child process from process Id

Hi any one knows in node JS how to get a child process from a process id? 嗨,有人知道在节点JS中如何从进程ID中获取子进程吗? something like this Thank you 像这样的东西谢谢

var pid="1212";
var process=getprocess(pid)

不幸的是,我没有为此得到任何Node JS代码,但是我找到了一个解决方案,方法是通过以下方式将Power Shell脚本作为子进程运行,并通过传递进程ID作为参数。

$a=Get-WmiObject win32_process | where {$_.ParentProcessId -eq $processid } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取在nodejs中使用child_process执行的命令的输出? - How to get the output of command executed using child_process in nodejs? NodeJS-从shell脚本exec中获取进程ID - NodeJS- get process ID from within shell script exec 如何将标准输出从一个子进程传递到 nodejs 中的另一个子进程? - How can I pass stdout from one child process to another child process in nodejs? 如何阻止nodejs杀死memory之外的子进程? - How to stop nodejs from killing a child process on out of memory? 如何从Node.js中的守护程序生成gpg子进程? - How to spawn a gpg child process from a daemon in nodejs? 从子进程(NodeJS)调用setTimeout - Calling setTimeout from child process (NodeJS) NodeJS如何检查子进程是否创建成功 - How to check if child process is created successfully in NodeJS 在Windows OS上使用child_process.spawn启动bat时如何从NodeJS获取输出,并且该bat将打开一个新终端 - How to get the output from NodeJS when use the child_process.spawn to launch a bat on windows OS, and the bat will open a new terminal NodeJS 在 raspi 上使用命令 df -h 从 child_process 获取 output - NodeJS get output from child_process with command df -h on raspi 如何从自定义节点REPL获取子进程中的输入 - How to get input in child process from custom node REPL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM