Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kexec

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kexec - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

demo/demovp-pids.js

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc