When I spawn a process with var proc = child_process.spawn("/usr/sbin/long_running_binary")
, I would like to have access to information about proc
as its own process. I can run process.cpuUsage
and process.cwd()
and process.uptime()
for the current node process, but how do I find this metadata for proc
?
Asked
Active
Viewed 126 times
0

Coder
- 597
- 7
- 22
1 Answers
0
I don't think Node.js has a built-in way for you to do that.
I would spawn another process to check on the process you spawned using the process id:
proc.pid
Example command for getting pid usage in Linux: https://stackoverflow.com/a/1221597/536950
-
I need a cross-platform answer for this, not just limited to Linux, but spanning BSD and OSX as well. I didn't have a Linux tag on this question for this reason. – Coder Mar 27 '17 at 17:09