# mysql-async-simple

> An async wrapper for mysql client

Latest version **1.0.3** (published 2020-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install mysql-async-simple
pnpm add mysql-async-simple
yarn add mysql-async-simple
bun add mysql-async-simple
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-10-09 |
| First published | 2020-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Imad Hashmi |
| Maintainers | hashgit |
| Keywords | mysql, async, nodejs |

## Links

- npm: https://www.npmjs.com/package/mysql-async-simple
- Repository: https://github.com/hashgit/mysql-async-simple
- Homepage: https://github.com/hashgit/mysql-async-simple#readme
- Issues: https://github.com/hashgit/mysql-async-simple/issues
- npm.io page: https://npm.io/package/mysql-async-simple

## Dependencies (1)

- [util](https://npm.io/package/util.md) ^0.12.3

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-10-09
- 1.0.1 — 2020-10-09
- 1.0.0 — 2020-10-09

## README

This package wraps the mysql nodejs client package (https://www.npmjs.com/package/mysql) into an async/await library.

## Basic Example

```javascript
const { makeDb } = require('mysql-async-simple');
const mysql = require("mysql");

const connection = mysql.createConnection({
    host: process.env.HOST,
    user: process.env.USER,
    password: process.env.PASSWORD,
    database: process.env.DB
});
const db = makeDb();
await db.connect(connection);

try {
    const users = await db.query(connection, 'SELECT * FROM users');
} catch (e) {
    // handle exception
} finally {
    await db.close(connection);
}
```

For more information visit github
https://github.com/hashgit/mysql-async-simple#readme

### NPM
Available to install as a package at npm registry (https://www.npmjs.com/package/mysql-async-simple)

### Credits
This package is based on this blog post by Michał Męciński
https://codeburst.io/node-js-mysql-and-async-await-6fb25b01b628

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