Skip to content
/ r4y Public

A minimalist TypeScript library for spawning and executing child processes with configurable logging. Built for automation, scripting, and CLI tools, following the Unix philosophy.

Notifications You must be signed in to change notification settings

x71c9/r4y

Repository files navigation

r4y

A typescript library for spawning and executing child processes.

Implementation

A common implementation is the following:

import ray from 'r4y';

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

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

Configuration

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
type LogMethod = 'trace' | 'debug' | 'info' | 'warn' | 'error';

Unix philosophy

This repo try to follow the Unix philosophy.

Name

r4y stands for ray, like in Radioactive ray.

Other related repositories

3xp A typescript library for validating objects.

i0n A typescript library for console logging.

w3i A typescript library for handling configurations.

About

A minimalist TypeScript library for spawning and executing child processes with configurable logging. Built for automation, scripting, and CLI tools, following the Unix philosophy.

Resources

Stars

Watchers

Forks

Packages

No packages published