Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify cli options and API in README #445

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
356 changes: 121 additions & 235 deletions README.md

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated by typedoc

264 changes: 264 additions & 0 deletions docs/classes/Command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# Class: Command
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to separate folder docs

Updated links in the README.md to this file as entry point for documentation


## Implements

- `CommandInfo`

## Table of contents

### Constructors

- [constructor](Command.md#constructor)

### Properties

- [close](Command.md#close)
- [command](Command.md#command)
- [cwd](Command.md#cwd)
- [env](Command.md#env)
- [error](Command.md#error)
- [exited](Command.md#exited)
- [index](Command.md#index)
- [killProcess](Command.md#killprocess)
- [killed](Command.md#killed)
- [name](Command.md#name)
- [pid](Command.md#pid)
- [prefixColor](Command.md#prefixcolor)
- [process](Command.md#process)
- [spawn](Command.md#spawn)
- [spawnOpts](Command.md#spawnopts)
- [stderr](Command.md#stderr)
- [stdin](Command.md#stdin)
- [stdout](Command.md#stdout)
- [timer](Command.md#timer)

### Accessors

- [killable](Command.md#killable)

### Methods

- [kill](Command.md#kill)
- [start](Command.md#start)
- [canKill](Command.md#cankill)

## Constructors

### constructor

• **new Command**(`«destructured»`, `spawnOpts`, `spawn`, `killProcess`)

#### Parameters

| Name | Type |
| :--------------- | :------------------------------------ |
| `«destructured»` | `CommandInfo` & { `index`: `number` } |
| `spawnOpts` | `SpawnOptions` |
| `spawn` | `SpawnCommand` |
| `killProcess` | `KillProcess` |

## Properties

### close

• `Readonly` **close**: `Subject`<[`CloseEvent`](../interfaces/CloseEvent.md)\>

---

### command

• `Readonly` **command**: `string`

**`Inherit Doc`**

#### Implementation of

CommandInfo.command

---

### cwd

• `Optional` `Readonly` **cwd**: `string`

**`Inherit Doc`**

#### Implementation of

CommandInfo.cwd

---

### env

• `Readonly` **env**: `Record`<`string`, `unknown`\>

**`Inherit Doc`**

#### Implementation of

CommandInfo.env

---

### error

• `Readonly` **error**: `Subject`<`unknown`\>

---

### exited

• **exited**: `boolean` = `false`

---

### index

• `Readonly` **index**: `number`

---

### killProcess

• `Private` `Readonly` **killProcess**: `KillProcess`

---

### killed

• **killed**: `boolean` = `false`

---

### name

• `Readonly` **name**: `string`

**`Inherit Doc`**

#### Implementation of

CommandInfo.name

---

### pid

• `Optional` **pid**: `number`

---

### prefixColor

• `Optional` `Readonly` **prefixColor**: `string`

**`Inherit Doc`**

#### Implementation of

CommandInfo.prefixColor

---

### process

• `Optional` **process**: `ChildProcess`

---

### spawn

• `Private` `Readonly` **spawn**: `SpawnCommand`

---

### spawnOpts

• `Private` `Readonly` **spawnOpts**: `SpawnOptions`

---

### stderr

• `Readonly` **stderr**: `Subject`<`Buffer`\>

---

### stdin

• `Optional` **stdin**: `Writable`

---

### stdout

• `Readonly` **stdout**: `Subject`<`Buffer`\>

---

### timer

• `Readonly` **timer**: `Subject`<[`TimerEvent`](../interfaces/TimerEvent.md)\>

## Accessors

### killable

• `get` **killable**(): `boolean`

#### Returns

`boolean`

**`Deprecated`**

## Methods

### kill

▸ **kill**(`code?`): `void`

Kills this command, optionally specifying a signal to send to it.

#### Parameters

| Name | Type |
| :------ | :------- |
| `code?` | `string` |

#### Returns

`void`

---

### start

▸ **start**(): `void`

Starts this command, piping output, error and close events onto the corresponding observables.

#### Returns

`void`

---

### canKill

▸ `Static` **canKill**(`command`): command is Command & Object

Detects whether a command can be killed.

Also works as a type guard on the input `command`.

#### Parameters

| Name | Type |
| :-------- | :---------------------- |
| `command` | [`Command`](Command.md) |

#### Returns

command is Command & Object
95 changes: 95 additions & 0 deletions docs/classes/InputHandler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Class: InputHandler

Sends input from concurrently through to commands.

Input can start with a command identifier, in which case it will be sent to that specific command.
For instance, `0:bla` will send `bla` to command at index `0`, and `server:stop` will send `stop`
to command with name `server`.

If the input doesn't start with a command identifier, it is then always sent to the default target.

## Implements

- [`FlowController`](../interfaces/FlowController.md)

## Table of contents

### Constructors

- [constructor](InputHandler.md#constructor)

### Properties

- [defaultInputTarget](InputHandler.md#defaultinputtarget)
- [inputStream](InputHandler.md#inputstream)
- [logger](InputHandler.md#logger)
- [pauseInputStreamOnFinish](InputHandler.md#pauseinputstreamonfinish)

### Methods

- [handle](InputHandler.md#handle)

## Constructors

### constructor

• **new InputHandler**(`«destructured»`)

#### Parameters

| Name | Type |
| :---------------------------- | :----------------------------------------------------- |
| `«destructured»` | `Object` |
| › `defaultInputTarget?` | [`CommandIdentifier`](../modules.md#commandidentifier) |
| › `inputStream?` | `Readable` |
| › `logger` | [`Logger`](Logger.md) |
| › `pauseInputStreamOnFinish?` | `boolean` |

## Properties

### defaultInputTarget

• `Private` `Readonly` **defaultInputTarget**: [`CommandIdentifier`](../modules.md#commandidentifier)

---

### inputStream

• `Private` `Optional` `Readonly` **inputStream**: `Readable`

---

### logger

• `Private` `Readonly` **logger**: [`Logger`](Logger.md)

---

### pauseInputStreamOnFinish

• `Private` `Readonly` **pauseInputStreamOnFinish**: `boolean`

## Methods

### handle

▸ **handle**(`commands`): `Object`

#### Parameters

| Name | Type |
| :--------- | :------------------------ |
| `commands` | [`Command`](Command.md)[] |

#### Returns

`Object`

| Name | Type |
| :---------- | :-------------------------- |
| `commands` | [`Command`](Command.md)[] |
| `onFinish?` | () => `undefined` \| `void` |

#### Implementation of

[FlowController](../interfaces/FlowController.md).[handle](../interfaces/FlowController.md#handle)
Loading