Comparing version 0.1.1 to 0.1.2
@@ -0,1 +1,5 @@ | ||
## 2016-06-23 | ||
- Publish 0.1.2 | ||
- change `command` and `argument` matching to case insensitive. | ||
## 2016-05-05 | ||
@@ -2,0 +6,0 @@ - Publish 0.1.1 update table-parser to 0.1.1 |
@@ -126,7 +126,7 @@ var ChildProcess = require('child_process'); | ||
if( query.command ){ | ||
filter[ 'command' ] = new RegExp( query.command ); | ||
filter[ 'command' ] = new RegExp( query.command, 'i' ); | ||
} | ||
if( query.arguments ){ | ||
filter[ 'arguments' ] = new RegExp( query.arguments ); | ||
filter[ 'arguments' ] = new RegExp( query.arguments, 'i' ); | ||
} | ||
@@ -133,0 +133,0 @@ |
{ | ||
"name": "ps-node", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A process lookup utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,3 +18,3 @@ # ps [![Build Status](https://travis-ci.org/neekey/ps.svg)](https://travis-ci.org/neekey/ps) | ||
- 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`. | ||
- 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). | ||
- 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. | ||
@@ -145,2 +145,2 @@ ## Compatibility | ||
- [multiple-bytes characters may cause parse error](https://github.com/neekey/table-parser). | ||
- [multiple-bytes characters may cause parse error](https://github.com/neekey/table-parser/issues/4). |
@@ -7,3 +7,4 @@ var PS = require( '../index' ); | ||
var serverPath = Path.resolve( __dirname, './node_process_for_test.js' ); | ||
var child = CP.fork( serverPath ); | ||
var UpperCaseArg = '--UPPER_CASE'; | ||
var child = CP.fork( serverPath, [ UpperCaseArg ] ); | ||
var pid = child.pid; | ||
@@ -32,2 +33,24 @@ | ||
}); | ||
it( 'by arguments, the matching should be case insensitive ', function( done ){ | ||
PS.lookup({ arguments: 'UPPER_CASE' }, function( err, list ){ | ||
assert.equal( list.length, 1 ); | ||
assert.equal( list[0].pid, pid ); | ||
assert.equal( list[0].arguments[0], serverPath ); | ||
PS.lookup({ arguments: 'upper_case' }, function( err, list ){ | ||
assert.equal( list.length, 1 ); | ||
assert.equal( list[0].pid, pid ); | ||
assert.equal( list[0].arguments[0], serverPath ); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it( 'empty result list should be safe ', function( done ){ | ||
PS.lookup({ command: 'NOT_EXIST', psargs: 'l' }, function( err, list ){ | ||
assert.equal( list.length, 0 ); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -34,0 +57,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15417
260