DefinitelyTyped/types/find-process/find-process-tests.ts
buaban 428a996d6b Add types definition for find-process (#28877)
* Add types definition for find-process

* Add new line at EOF

* Compile TS LINT

* 1. change import syntax.  2. Remove comments.
2018-09-17 01:30:49 -07:00

17 lines
539 B
TypeScript

/// <reference types="node" />
import find = require('find-process');
find('pid', 12345).then((processList) => {
processList.forEach((ps) => {
console.log('Full command with args: ' + ps.cmd);
console.log('User group ID (for *nix): ' + ps.gid);
console.log('command/process name: ' + ps.name);
console.log('Process ID: ' + ps.pid);
console.log('Parent process ID: ' + ps.ppid);
console.log('User ID (for *nix): ' + ps.uid);
});
}, (err) => {
console.log(err.stack || err);
});