# hapi-knex2

> hapi knex plugin

Latest version **0.0.4** (published 2016-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install hapi-knex2
pnpm add hapi-knex2
yarn add hapi-knex2
bun add hapi-knex2
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2016-12-22 |
| First published | 2016-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | sebasgarcep |

## Links

- npm: https://www.npmjs.com/package/hapi-knex2
- Repository: https://github.com/sebasgarcep/hapi-knex2
- Issues: https://github.com/sebasgarcep/hapi-knex2/issues
- npm.io page: https://npm.io/package/hapi-knex2

## Dependencies (2)

- [joi](https://npm.io/package/joi.md) ^8.0.5
- [hoek](https://npm.io/package/hoek.md) ^3.0.4

## Recent versions

- 0.0.4 (latest) — 2016-12-22
- 0.0.2 — 2016-12-21
- 0.0.1 — 2016-12-21

## README

# hapi-knex2

Knex plugin for hapi.


### Install

```bash
$ npm install knex hapi-knex2
```


### Usage

For knex to work install one of the database drivers found in the knex documentation. Then you can do as follows:

```javascript
const Hapi = require('hapi');

const server = new Hapi.Server(/* options */);

// some other stuff ...

server.register({
  register: require('hapi-knex2'),
  options: {
    knex: {
      client: 'mysql',
      connection: {
        host : '127.0.0.1',
        user : 'your_database_user',
        password : 'your_database_password',
        database : 'myapp_test'
      },
    },
  },
}, err => {
  if (err) throw err;

  server.start();
});
```


### License

MIT

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