# r4y

> A NodeJS library for managing child processes

Latest version **0.9.0** (published 2025-01-20) · UNLICENSED license · 0 weekly downloads

## Install

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

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2025-01-20 |
| First published | 2023-08-21 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 45.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | x71c9 |
| Maintainers | x71c9 |

## Links

- npm: https://www.npmjs.com/package/r4y
- Repository: git@github.com:x71c9/r4y
- npm.io page: https://npm.io/package/r4y

## Dependencies (2)

- [i0n](https://npm.io/package/i0n.md) ^0.9.0
- [w3i](https://npm.io/package/w3i.md) ^0.3.0

## Recent versions

- 0.9.0 (latest) — 2025-01-20
- 0.8.0 — 2024-12-22
- 0.7.0 — 2024-02-11
- 0.6.0 — 2023-12-30
- 0.5.2 — 2023-12-29
- 0.5.1 — 2023-11-20
- 0.5.0 — 2023-11-19
- 0.4.3 — 2023-11-19
- 0.4.2 — 2023-11-19
- 0.4.1 — 2023-11-19
- 0.4.0 — 2023-11-19
- 0.3.1 — 2023-09-20
- 0.3.0 — 2023-09-07
- 0.2.0 — 2023-08-23
- 0.1.1 — 2023-08-22
- … 3 more at https://npm.io/package/r4y/versions

## README

# r4y

A typescript library for spawning and executing child processes.

## Implementation

A common implementation is the following:

```typescript
import ray from 'r4y';

const response = await ray.execute('echo $WHATEVER');
console.log(response);

await ray.spawn('find . -type f | wc');
```

## Configuration

```typescript
import ray from 'r4y';
ray.config.set({
  debug: false,
  spin: false,
  spawn: {
    log: {
      stdout: 'trace',
      stderr: 'error',
    }
  },
});
```

### Configuration parameters

| Parameter name | Parameter type | Parameter description |
| -------------- | -------------- | --------------------- |
| `debug` | `boolean` | Wheater or not to console log debugging information like child ID |
| `spin` | `boolean` | Wheater or not to show a spinning console log |
| `spawn.log.stdout` | `LogMethod` | How the child process should log its `stdout` |
| `spawn.log.stderr` | `LogMethod` | How the child process should log its `stderr` |

```typescript
type LogMethod = 'trace' | 'debug' | 'info' | 'warn' | 'error';
```

## Unix philosophy

This repo try to follow the
[Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy).

## Name

`r4y` stands for ray, like in [Radioactive ray](https://en.wikipedia.org/wiki/Radiation).

## Other related repositories

[`3xp`](https://www.npmjs.com/package/3xp) A typescript library for validating objects.

[`i0n`](https://www.npmjs.com/package/i0n) A typescript library for console logging.

[`w3i`](https://www.npmjs.com/package/w3i) A typescript library for handling configurations.

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