Socket
Socket
Sign inDemoInstall

pseudoexec

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pseudoexec

Node JS doesn't provide any means for processes to replace themselves through functions from the [`exec(3)`](https://man7.org/linux/man-pages/man3/exec.3.html) family. Thus, `pseudoexec` provides a convenience wrapper over [`child_process.spawn()`](https:


Version published
Maintainers
1
Install size
6.88 kB
Created

Readme

Source

Ersatz exec(3) for Node JS

Node JS doesn't provide any means for processes to replace themselves through functions from the exec(3) family. Thus, pseudoexec provides a convenience wrapper over child_process.spawn() that causes the child process to inherit the parent process' stdio(3) standard input/output/error streams and handle all the syscalls(2) sent to the parent.

⚠️ Warning: Windows is not fully supported, because it doesn't support signals.

Example

const { pseudoexec } = require("pseudoexec");

pseudoexec("sl", ["-f", "-a"]).then(process.exit);

Maintenance

This package uses process.binding() (DEP0111) to retrieve a list of signals specific to the current operating system, exactly in the same way as Node JS does internally. This function is pending deprecation and might not be available in future versions of Node JS.

Alternatives

  • node-kexec (linux-only)

Keywords

FAQs

Last updated on 05 Sep 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc