open-index/open-npm huggingface dataset:
npm package: @hume/app-ws
Description: Websockets service application abstraction to decrease the load in the HTTP APIs for common read only requests.
Latest version: 0.7.2
Deprecated: Project discontinued

# hume WS app

Websockets service application abstraction to decrease the load in the HTTP APIs for common read only requests.

For now it keeps an updated cache in memory of the needed data. All the connected clients will receive an update of the requested one in an interval.

## Install

:coffee: Install [Node.js](https://nodejs.org/download) v8 and then:

```sh
npm i @hume/app-ws
```

### Dependencies

- Install the [dependencies](https://github.com/uNetworking/bindings/tree/master/nodejs#installation) for the websockets library from your OS package manager.

## Use

:pencil: Please visit the [the example](../../example/ws.js).

### Client side

Two query parameters are supported:

- `token` (string) - Mandatory, see the last point of this document.
- `filter` (string) - To serve only the the contend under one key of the cache. (default: null)

Please visit [the example](../../example/ws.html).

## API

:eyes: Full specification.

### `app.start(cache, token, apm) -> null`

Start the LoopBack app.

- `cache` (async function) - Method to get the data to serve.
- `token` (string) - For now we only need basic auth to avoid automated scrappers. If not passed auth is disabled. (default: null)
- `apm` (object) - Elastic APM [express.js agent](https://www.elastic.co/guide/en/apm/agent/nodejs/current/express.html) instance (already started).

### `async app.stop() -> null`

Stop the websocket service, useful in tests.
npm package: @hume/script
Description: Devops tasks command line client for hume.
Latest version: 0.7.2
Deprecated: Project discontinued

# hume devops

Devops tasks command line client for hume.

## Install

:coffee: Install [Node.js](https://nodejs.org/download) v8 and then:

```sh
npm i -g @hume/script
```

## Use

:pencil: Please use the argument `-h`.

```sh
hume -h
```

Output:

```sh
Usage: hume [options] <app>

Some useful development tasks.Only one options is supported at the same time.

Options:

  -V, --version       output the version number
  -s, --start <path>  Start a local app with a IBM Cloud instance environment variables, ie: ./server.js
  -h, --help          output usage information
```
npm package: @hume/utils-test
Description: Some helpers shared among the tests.
Latest version: 0.8.0
Deprecated: Project discontinued

# hume utils test

Some helpers shared among the tests.

## Install

:coffee: Install [Node.js](https://nodejs.org/download) v8 and then:

```sh
npm i @hume/utils-test
```

## Use

:pencil: You can visit the complete example [in this tests](./test).

```js
const utilsTest = require('@hume/utils-test');

console.log('Version');
console.log(utilsTst.version);
```

## API

:eyes: Full specification.

### `version`

The actual version of the library.

- `version` (string) - Version number.

### `shoot`

A wrapper for [snap-shot-it'](https://www.npmjs.com/package/snap-shot-it').

### `async throwsAsync(block, errRegex) -> null`

Am async version of [assert.throws](https://nodejs.org/api/assert.html#assert_assert_throws_block_error_message).

- `block` (function) - Piece of code (returning a promise) to be checked.
- `errRegex` (object) - Regular expresion to confirm the expected error.

### `request`

A wrapper for [supertest](https://github.com/chriso/supertest) with some additions (see next points).

### `async request.login(creds, opts) -> res`

To login in Loopback using supertest in an easy way.

- `creds` (object) - User credentials:
  - `email` (string) - Email of the user to create.
  - `password` (string) - Password of the user to create.
- `opts` (object) - Optional params:

  - `path` (string) - Endpoint path. (default: '/api/users/login')

- `res` (object) - The response with.
  - `id` (string) - The new token.