Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to 0.1.6 #48

Merged
merged 8 commits into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ var Exec = module.exports = exports = function (args, callback) {
* @param {String|String[]} query.pid
* @param {String} query.command RegExp String
* @param {String} query.arguments RegExp String
* @param {String|array} query.psargs
* @param {Function} callback
* @param {Object=null} callback.err
* @param {Object[]} callback.processList
Expand All @@ -115,9 +116,9 @@ var Exec = module.exports = exports = function (args, callback) {
exports.lookup = function (query, callback) {

/**
* add 'l' as default ps arguments, since the default ps output in linux like "ubuntu", wont include command arguments
* add 'lx' as default ps arguments, since the default ps output in linux like "ubuntu", wont include command arguments
*/
var exeArgs = query.psargs || ['l'];
var exeArgs = query.psargs || ['lx'];
var filter = {};
var idList;

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ npm install ps-node

This module uses different tools to get process list:

- Linux / Mac: use `ps` command. Since the default result from shell command `$ ps` will not contain "command arguments" in linux like "ubuntu", ps-node add arguments `l` as default. Which means, the default value for option `psargs` is `l`.
- Linux / Mac: use `ps` command. Since the default result from shell command `$ ps` will not contain "command arguments" in linux like "ubuntu", ps-node add arguments `lx` as default. Which means, the default value for option `psargs` is `lx`.
- Win: use command `wmic process get ProcessId,CommandLine` through "cmd", more info about wmic is [here](https://social.technet.microsoft.com/Forums/windowsserver/en-US/ab6c7e6e-4ad4-4237-bab3-0349cd76c094/wmic-command-line-utilities?forum=winservercore). Anyway, there is also another tool name [tasklist](https://technet.microsoft.com/en-us/library/bb491010.aspx) in windows, which can also list all the running processes, but lack of command arguments infomation. But compared to wmic, I think this tool should have a higher performance. You should take a look at the wrapper for this tool [tasklist](https://github.com/sindresorhus/tasklist) by @sindresorhs if you are interested.

## Compatibility
Expand Down