Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Jul 18, 2019
1 parent dcebf73 commit 37b6903
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,38 @@
[![Coverage Status](https://coveralls.io/repos/github/kevgo/observable-process/badge.svg?branch=master)](https://coveralls.io/github/kevgo/observable-process?branch=master)

ObservableProcess decorates the low-level
[Node.JS process library](https://nodejs.org/api/process.html) with convenience
methods to make working with long-running processes more convenient. In
particular:

- make a output string combining STDOUT and STDERR available
- provide access to the accumulated output of STDOUT, STDERR, and their
combination
- allow to await text or regular expressions in the output
[Node.JS ChildProcess](https://nodejs.org/api/child_process.html) model with
functionality to observe the behavior of long-running processes more
conveniently. In particular:

- easier access to the complete textual content of the
[stdout](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout)
and
[stderr](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr)
streams
- augments `stdout` and `stderr` with methods to search for textual content
- create a new `output` stream that combines `stdout` and `stderr`
- await the process end
- easier access to the process exit code
- easy determination whether the process ended naturally or was manually
terminated
- signals whether the process ended naturally or was manually terminated

This is helpful in many situations, for example in testing.

## Setup

To add this library to your code base:
Add this library to your code base:

```shell
$ npm install --save observable-process
```

or

```
$ yarn add observable process
$ npm install observable-process
```

To load this library into your JavaScript code:
Load this library into your JavaScript code:

```js
const { createObservableProcess } = require("observable-process")
```

or
- or -

```js
import { createObservableProcess } from "observable-process"
Expand Down

0 comments on commit 37b6903

Please sign in to comment.