<commit_before># glesys-api

[![npm](https://img.shields.io/npm/v/glesys-api.svg)](https://www.npmjs.com/package/glesys-api)
![build](https://github.com/jwilsson/glesys-api-node/workflows/build/badge.svg)
[![Coverage Status](https://coveralls.io/repos/jwilsson/glesys-api-node/badge.svg?branch=master&service=github)](https://coveralls.io/github/jwilsson/glesys-api-node?branch=master)

A Node.js wrapper for the GleSYS API.

## Installation
*Note: Node 14.15.0 (LTS) or later is required.*

```bash
npm install glesys-api
```

## Usage
```js
import GleSYSAPI from ''glesys-api'';

const glesys = new GleSYSAPI({
    apiKey: 'key',
    apiUser: 'user',
});

(async () => {
    try {
        const { body } = await glesys.api.serviceInfo();

        console.log(body)
    } catch (e) {
        console.error(e);
    }

    glesys.email.createAccount({
        emailaccount: '<EMAIL>',
        password: 'password',
    });
})();
```

## Available methods
### account
* [`GleSYSAPI.account.info()`](https://github.com/GleSYS/API/wiki/API-Documentation#accountinfo)

### api
* [`GleSYSAPI.api.listFunctions()`](https://github.com/GleSYS/API/wiki/API-Documentation#apilistfunctions)
* [`GleSYSAPI.api.maintenance()`](https://github.com/GleSYS/API/wiki/API-Documentation#apimaintenance)
* [`GleSYSAPI.api.serviceInfo()`](https://github.com/GleSYS/API/wiki/API-Documentation#apiserviceinfo)<commit_msg>Use top-level await in example<commit_after># glesys-api

[![npm](https://img.shields.io/npm/v/glesys-api.svg)](https://www.npmjs.com/package/glesys-api)
![build](https://github.com/jwilsson/glesys-api-node/workflows/build/badge.svg)
[![Coverage Status](https://coveralls.io/repos/jwilsson/glesys-api-node/badge.svg?branch=master&service=github)](https://coveralls.io/github/jwilsson/glesys-api-node?branch=master)

A Node.js wrapper for the GleSYS API.

## Installation
*Note: Node 14.15.0 (LTS) or later is required.*

```bash
npm install glesys-api
```

## Usage
```js
import GleSYSAPI from ''glesys-api'';

const glesys = new GleSYSAPI({
    apiKey: 'key',
    apiUser: 'user',
});

try {
    const { body } = await glesys.api.serviceInfo();

    console.log(body)
} catch (e) {
    console.error(e);
}

glesys.email.createAccount({
    emailaccount: '<EMAIL>',
    password: 'password',
});
```

## Available methods
### account
* [`GleSYSAPI.account.info()`](https://github.com/GleSYS/API/wiki/API-Documentation#accountinfo)

### api
* [`GleSYSAPI.api.listFunctions()`](https://github.com/GleSYS/API/wiki/API-Documentation#apilistfunctions)
* [`GleSYSAPI.api.maintenance()`](https://github.com/GleSYS/API/wiki/API-Documentation#apimaintenance)
* [`GleSYSAPI.api.serviceInfo()`](https://github.com/GleSYS/API/wiki/API-Documentation#apiserviceinfo)
{'fraction_non_alphanumeric': 0.1943231441048035, 'fraction_numerical': 0.00363901018922853, 'mean_word_length': 4.59877800407332, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 18, 'lorem ipsum': 0, 'www.': 2, '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': '1707148', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1008, 'n_words': 128}