# 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:

Latest version **0.2.0** (published 2021-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install pseudoexec
pnpm add pseudoexec
yarn add pseudoexec
bun add pseudoexec
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-09-05 |
| First published | 2021-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | 0x2b3bfa0@googlemail.com |
| Maintainers | 0x2b3bfa0 |
| Keywords | exec, process |

## Links

- npm: https://www.npmjs.com/package/pseudoexec
- Repository: https://github.com/0x2b3bfa0/node-pseudoexec
- Homepage: https://github.com/0x2b3bfa0/node-pseudoexec#readme
- Issues: https://github.com/0x2b3bfa0/node-pseudoexec/issues
- npm.io page: https://npm.io/package/pseudoexec

## Recent versions

- 0.2.0 (latest) — 2021-09-05
- 0.1.4 — 2021-08-29
- 0.1.3 — 2021-08-29
- 0.1.2 — 2021-08-29
- 0.1.1 — 2021-08-29
- 0.1.0 — 2021-08-29

## README

# Ersatz [`exec(3)`](https://man7.org/linux/man-pages/man3/exec.3.html) for [Node JS](https://nodejs.org)

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://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) that causes the child process to [`inherit`](https://nodejs.org/api/child_process.html#child_process_options_stdio) the parent process' [`stdio(3)`](https://man7.org/linux/man-pages/man3/stdio.3.html) standard [input](https://nodejs.org/api/process.html#process_process_stdin)/[output](https://nodejs.org/api/process.html#process_process_stdout)/[error](https://nodejs.org/api/process.html#process_process_stderr) streams and [handle](https://nodejs.org/api/process.html#process_signal_events) all the [`syscalls(2)`](https://man7.org/linux/man-pages/man2/syscalls.2.html)
 sent to the parent.

⚠️ **Warning:** Windows is not fully supported, because it [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events).

## Example

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

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

## Maintenance

This package uses [`process.binding()` (DEP0111)](https://nodejs.org/api/deprecations.html#DEP0111) to retrieve a list of signals specific to the current operating system, exactly in the same way as Node JS does [internally](https://github.com/nodejs/node/blob/73d5f8a843c89707313eb2cf2b99af59096b738a/lib/internal/util.js#L44). This function is pending deprecation and might not be available in future versions of Node JS.

## Alternatives

* [`node-kexec`](https://github.com/jprichardson/node-kexec) (linux-only)

---
_Source: https://npm.io/package/pseudoexec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
