# query-face-node

> This is the best query-face parser and executor library for Node.js that enables you to manipulate your data freely without creating endpoints.

Latest version **1.2.0** (published 2020-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install query-face-node
pnpm add query-face-node
yarn add query-face-node
bun add query-face-node
```

## 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.2.0 |
| Published | 2020-07-26 |
| First published | 2019-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 56 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | engin ustun |
| Maintainers | enginustun |

## Links

- npm: https://www.npmjs.com/package/query-face-node
- Repository: https://github.com/enginustun/query-face-node
- Homepage: https://github.com/enginustun/query-face-node#readme
- Issues: https://github.com/enginustun/query-face-node/issues
- npm.io page: https://npm.io/package/query-face-node

## Dependencies (3)

- [knex](https://npm.io/package/knex.md) ^0.20.13
- [winston](https://npm.io/package/winston.md) ^3.2.1
- [async-validator](https://npm.io/package/async-validator.md) ^3.2.4

## Recent versions

- 1.2.0 (latest) — 2020-07-26
- 1.1.0 — 2020-04-06
- 1.0.0 — 2020-03-22
- 0.1.2 — 2020-03-22
- 0.1.1 — 2020-03-22
- 0.1.0 — 2020-03-21
- 0.0.4 — 2020-03-15
- 0.0.3 — 2019-12-19
- 0.0.2 — 2019-10-12
- 0.0.1 — 2019-10-12

## README

# query-face-node &middot; [![Build Status](https://travis-ci.org/enginustun/query-face-node.svg?branch=master)](https://travis-ci.org/enginustun/query-face-node) ![npm](https://img.shields.io/npm/v/query-face-node) ![GitHub](https://img.shields.io/github/license/enginustun/query-face-node)

This is [query-face](https://github.com/enginustun/query-face) parser and executor library for Node.js that enables you to manipulate your data freely without endpoints.

- install library.

  ```
  npm install --save query-face-node
  ```

- setting up your configuration

  You need to define databases (at least one) based on [knex](https://knexjs.org) documentation. We recommend that you use [dotenv](https://github.com/motdotla/dotenv) library to manage your environment variables.

  ```javascript
  //databases.js
  require('dotenv').config();
  module.exports = {
    todoDB: require('knex')({
      client: process.env.DB_CLIENT,
      connection: {
        host: process.env.DB_HOST,
        port: process.env.DB_PORT,
        user: process.env.DB_USER,
        password: process.env.DB_PASSWORD,
        database: process.env.DB_DATABASE,
      },
      migrations: {
        tableName: process.env.DB_MIGRATION_TABLE,
        directory: process.env.DB_MIGRATION_DIRECTORY,
      },
      seeds: {
        directory: process.env.DB_SEEDS_DIRECTORY,
      },
    }),
  };
  ```

  Based on your database client configuration you need to install (at least) one of the following database drivers.

  ```
  npm install pg
  npm install sqlite3
  npm install mysql
  npm install mysql2
  npm install oracle
  npm install mssql
  ```

  Once you configure your databases, you can use queryFaceNode middlewares by setting queryFaceNode databases as follow. Also you need to add queryFaceNode middlewares to specific route you desired.

  ```javascript
  // app.js
  const express = require('express');
  const app = express();
  const queryFaceNode = require('query-face-node');
  const databases = require('./databases');

  queryFaceNode.setDatabase('todoDB', databases.todoDB);

  app.use(express.json());
  app.post('/api', ...queryFaceNode);
  ```

  You can manage your migration and seed files by using knex CLI or API.

  - For [migrations-CLI](https://knexjs.org/#Migrations-CLI)
  - For [seeds-CLI](https://knexjs.org/#Seeds-CLI)
  - For [migrations-API](https://knexjs.org/#Migrations-API)
  - For [seeds-API](https://knexjs.org/#Seeds-API)

## Documentation

  - [x] [API documentation](https://enginustun.github.io/query-face-node/)
  - [ ] Tutorials (not started)

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