
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@jcoreio/kexec
Advanced tools
This module causes your current Node.js process to be replaced by the process invoked by the parameter of this function. It's like the Ruby exec function. It currently does not work on Windows.
Fully compatible with Node.js version v0.10 and v0.11.
var kexec = require('kexec')
kexec('top') //your process now becomes top, can also accept parameters in one string
var kexec = require('kexec')
kexec('du', [ '-sh', '/etc/fstab' ]) //your process now becomes du, with the arguments indicated
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.
(The MIT License)
Copyright (c) 2011-2015 JP Richardson
FAQs
Replace your Node.js process with another process. Like Ruby exec.
We found that @jcoreio/kexec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.