<commit_before># Dockercloud

[![Circle CI](https://circleci.com/gh/cityofsurrey/dockercloud.svg?style=svg&circle-token=<KEY>)](https://circleci.com/gh/CityofSurrey/dockercloud)
<a href="https://codeclimate.com/github/CityofSurrey/dockercloud"><img src="https://codeclimate.com/github/CityofSurrey/dockercloud/badges/gpa.svg" /></a>
<a href="https://codeclimate.com/github/CityofSurrey/dockercloud/coverage"><img src="https://codeclimate.com/github/CityofSurrey/dockercloud/badges/coverage.svg" /></a>

Dockercloud is a Node.js library for Docker Cloud API.

## Installation

```
npm install dockercloud
```

## Usage

### Initilization

You need to instantiate a new instance to use this class:
```js
import DockerCloud from 'dockercloud'

const dockerCloud = new DockerCloud('username', 'password')
```

### Methods

All methods return promises.

#### connect

Connect to DockerCloud and listen for events.
This method is required to be called before using the waitUntil* methods.

Example:
```js
await dockerCloud.connect()
const stack = await dockerCloud.findStackById('stackId')
await dockerCloud.waitUntilStackIsTerminated(stack)

```

#### disconnect

Disconnect from DockerCloud.
This method returns nothing.

#### queryStacks

The value returned by the promise will be a list of the stacks in your account.

```js
const stacks = await dockerCloud.queryStacks()
```
<commit_msg>chore: update README.md (#22)<commit_after># Dockercloud

[![Circle CI](https://circleci.com/gh/cityofsurrey/dockercloud.svg?style=svg&circle-token=<KEY>)](https://circleci.com/gh/CityofSurrey/dockercloud)
<a href="https://codeclimate.com/github/CityofSurrey/dockercloud"><img src="https://codeclimate.com/github/CityofSurrey/dockercloud/badges/gpa.svg" /></a>
<a href="https://codeclimate.com/github/CityofSurrey/dockercloud/coverage"><img src="https://codeclimate.com/github/CityofSurrey/dockercloud/badges/coverage.svg" /></a>

Dockercloud is a Node.js library for Docker Cloud API.

## Installation

```
npm install dockercloud
```

## Usage

### Initilization

You need to instantiate a new instance to use this class:
```js
import DockerCloud from 'dockercloud'

const dockerCloud = new DockerCloud('username', 'password')
```

### Methods

All methods return promises.

#### connect

Connect to DockerCloud and listen for events.
This method is required to be called before using the waitUntil* methods.

Example:
```js
await dockerCloud.connect()
const stack = await dockerCloud.findStackById('stackId')
await dockerCloud.waitUntilStackIsTerminated(stack)

```

#### disconnect

This method disconnects the application from DockerCloud without any returned response.

#### queryStacks

The value returned by the promise will be a list of the stacks in your account.

```js
const stacks = await dockerCloud.queryStacks()
```

{'fraction_non_alphanumeric': 0.12987934705464868, 'fraction_numerical': 0.0007097232079489, 'mean_word_length': 5.648584905660377, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '993858', 'n_tokens_mistral': 922, 'n_tokens_neox': 843, 'n_words': 233}