Skip to content

Commit

Permalink
fix #18 get the same name COMMAND for child under darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Jun 21, 2016
1 parent 10b90e3 commit 209a45e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ module.exports = function childrenOfPid(pid, callback) {
// ps 20688 16965 R+
// ```
//
// Darwin:
// $ ps -A -o comm,ppid,pid,stat
// COMM PPID PID STAT
// /sbin/launchd 0 1 Ss
// /usr/libexec/Use 1 43 Ss
//
// Win32:
// 1. wmic PROCESS WHERE ParentProcessId=4604 GET Name,ParentProcessId,ProcessId,Status)
// 2. The order of head columns is fixed
Expand Down Expand Up @@ -112,6 +118,9 @@ function normalizeHeader(str) {
case 'Status':
return 'STAT';
break;
case 'COMM': // for darwin
return 'COMMAND';
break;
default:
throw new Error('Unknown process listing header: ' + str);
}
Expand Down

0 comments on commit 209a45e

Please sign in to comment.