# simple-mysql-query

> simple mysql query with promise

Latest version **1.1.4** (published 2019-07-26) · MIT license · 0 weekly downloads

## Install

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

## 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.1.4 |
| Published | 2019-07-26 |
| First published | 2018-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | chrunlee |
| Maintainers | chrunlee |
| Keywords | simple, mysql, query |

## Links

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

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^2.6.1
- [mysql](https://npm.io/package/mysql.md) ^2.15.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2019-07-26
- 1.1.3 — 2019-07-25
- 1.1.2 — 2019-07-24
- 1.1.1 — 2019-05-27
- 1.1.0 — 2018-11-01
- 1.0.0 — 2018-07-07

## README

# simple-mysql-query
simple mysql query with promise 

# install 
```
npm i simple-mysql-query
```

# usage
```
const query = require('simple-mysql-query');
```
#### set config in main file
```
query({
	host : '127.0.0.1',
	port : '3306',
	user : 'root',
	password : 'root',
	database : 'db'
})
```
#### query simple sql in other files
```
query({
	sql : 'select * from table where name=? ',
	params : ['name']
}).then(rs => {
	const list = rs[0];
	console.log(list);
}).catch(e => console.log(e));
```
#### query multi sql in other files
```
query([{
	sql : 'select * from table where name=? ',
	params : ['name']
},{
	sql : 'select * from table2 where name=?',
	params : ['name']
}]).then(rs => {
	const list = rs[0];
	console.log(list);
	const list2 = rs[1];
	console.log(list2);
}).catch(e => console.log(e));
```

# license 
MIT LICENSE

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