# @fabernovel/heart-mysql

> Store the results of analysis into a MySQL database

Latest version **4.0.1** (published 2023-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fabernovel/heart-mysql
pnpm add @fabernovel/heart-mysql
yarn add @fabernovel/heart-mysql
bun add @fabernovel/heart-mysql
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2023-10-08 |
| First published | 2023-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 <21 |
| Dependencies | 4 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Maintainers | thomasgiscos, gautierb, williamgoulois, cezarion, bastien.gatellier.fabernovel, arnaud.mombrial.npmjs, victorchabbert |

## Links

- npm: https://www.npmjs.com/package/@fabernovel/heart-mysql
- Repository: https://github.com/faberNovel/heart
- Homepage: https://heart.fabernovel.com
- Issues: https://github.com/faberNovel/heart/issues
- npm.io page: https://npm.io/package/@fabernovel/heart-mysql

## Dependencies (4)

- [@mikro-orm/core](https://npm.io/package/@mikro-orm/core.md) ^5.8.7
- [@mikro-orm/mysql](https://npm.io/package/@mikro-orm/mysql.md) ^5.8.7
- [@mikro-orm/migrations](https://npm.io/package/@mikro-orm/migrations.md) ^5.8.7
- [@fabernovel/heart-common](https://npm.io/package/@fabernovel/heart-common.md) ^4.0.0

## Recent versions

- 4.0.1 (latest) — 2023-10-08
- 4.0.0 — 2023-10-08
- 4.0.0-alpha.9 — 2023-07-31
- 4.0.0-alpha.8 — 2023-07-30
- 4.0.0-alpha.7 — 2023-07-30
- 4.0.0-alpha.6 — 2023-07-17

## README

# Heart MySQL

_Heart MySQL_ is a _listener_ module of _Heart_, which reacts to the end of an analysis and stores the results of an analysis in a MySQL database.

Note that you must install an _analysis_ module too, to have a minimum viable installation of _Heart_.

Read more about [the description and design of _Heart_](https://github.com/faberNovel/heart#readme).

# Usage

## Standalone

1. Install the package and an _analysis_ module, for example _[Heart GreenIT](https://www.npmjs.com/package/@fabernovel/heart-greenit)_

    ```bash
    npm install @fabernovel/heart-greenit @fabernovel/heart-mysql
    ```

    If you are using Yarn, npm < 7 or PNPM < 8, you also have to install _[Heart CLI](https://www.npmjs.com/package/@fabernovel/heart-cli)_ (which is automatically installed in more recent versions of these packages managers):

    ```bash
    npm install @fabernovel/heart-cli
    ```

2. In the project root folder, create a `.env` file with the database connection information set as a URL

    ```dotenv
    HEART_MYSQL_DATABASE_URL=mysql://login:password@127.0.0.1:3306
    ```

3. Start an analysis

    ```bash
    npx heart greenit --config '{"url":"https://www.fabernovel.com"}'
    ```

    OR 

    ```bash
    npx heart greenit --config config.json
    ```

    Once the analysis is done, the results are stored in your _MySQL_ database.

## Github Action

If you're using Github, you can simplify the integration of Heart in your CI scripts by using the [Github Action](https://github.com/marketplace/actions/heart-webpages-evaluation).

---
_Source: https://npm.io/package/@fabernovel/heart-mysql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
