0.2.7 • Published 1 year ago

@tedslittlerobot/cathy v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Cathy

A library to enable back-and-forth communication with an underlying script.

Installation

npm install @tedslittlerobot/cathy

Usage

Given the following bash script, which has some output and prompts...

#! /usr/bin/env bash

set -e

>&2 echo "Hello!"

>&2 echo -n "What is your name: "
read -r name
>&2 echo "Hello ${name}"

>&2 echo -n "How old are you? "
read -r age

>&2 echo "You are ${age}! Thanks"

The following script will automatically respond

import Cathy from '@tedslittlerobot/cathy';

const cathy = new Cathy(execa({stdio: 'pipe'})('./streamtest'));

cathy.converse('What is your name:', 'Jenny Franz');
cathy.converse('How old are you?', '999');

const response = await cathy.run();
0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago