Comparing version 0.1.1 to 0.1.2
{ | ||
"name" : "kexec", | ||
"version" : "0.1.1", | ||
"version" : "0.1.2", | ||
"description" : "Replace your Node.js process with another process. Like Ruby exec.", | ||
@@ -5,0 +5,0 @@ "homepage" : [ |
@@ -33,4 +33,27 @@ Node.js - kexec | ||
```javascript | ||
var kexec = require('kexec'); | ||
kexec('du', [ '-sh', '/etc/fstab' ]); //your process now becomes du, with the arguments indicated | ||
``` | ||
Details | ||
------- | ||
`kexec` can be called in either of two ways, as indicated by the examples, above. | ||
With one argument `arg`, that argument must be a string. The resulting system | ||
call is: | ||
execvp("/bin/sh", [ "/bin/sh", "-c", arg, 0 ]); | ||
With two arguments, the first (`cmd`) must be a string, and the second (`args`) an array of strings. The resulting | ||
system call is: | ||
execvp(cmd, [ cmd, args[0], args[1], ..., 0 ]); | ||
In the first case, the command is subject to shell parsing, and shell meta | ||
characters retain their special meanings. In the second case, the arguments | ||
are passed directly to `execvp`, without an intervening shell. | ||
License | ||
@@ -37,0 +60,0 @@ ------- |
@@ -8,3 +8,3 @@ var exec = require('child_process').exec | ||
test('+ kexec() - kexec echo', function(done) { | ||
test('+ kexec() - kexec echo - single argument', function(done) { | ||
var echoFile = path.join(__dirname, './files/echo.sh'); | ||
@@ -14,2 +14,4 @@ | ||
assert(stdout.trim() === 'hello world'); | ||
assert(stderr.trim() === ''); | ||
assert( error === null ); | ||
done(); | ||
@@ -16,0 +18,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
10184
19
52
78
0
5