Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@panbenson/kexec
Advanced tools
Replace your Node.js process with another process. Like Ruby exec.
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 @panbenson/kexec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.