# @leeqiang/q-router

> Q-Router for Koa2 ========

Latest version **1.0.9** (published 2023-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @leeqiang/q-router
pnpm add @leeqiang/q-router
yarn add @leeqiang/q-router
bun add @leeqiang/q-router
```

## 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.9 |
| Published | 2023-03-29 |
| First published | 2019-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | leeqiang |

## Links

- npm: https://www.npmjs.com/package/@leeqiang/q-router
- Repository: https://github.com/leeqiang/q-router
- Homepage: https://github.com/leeqiang/q-router#readme
- Issues: https://github.com/leeqiang/q-router/issues
- npm.io page: https://npm.io/package/@leeqiang/q-router

## Dependencies (4)

- [ajv](https://npm.io/package/ajv.md) ^6.10.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [koa-router](https://npm.io/package/koa-router.md) ^7.4.0
- [require-dir](https://npm.io/package/require-dir.md) ^1.2.0

## Recent versions

- 1.0.9 (latest) — 2023-03-29
- 1.0.8 — 2021-12-09
- 1.0.7 — 2019-12-24
- 1.0.6 — 2019-06-23
- 1.0.5 — 2019-06-21
- 1.0.4 — 2019-05-26
- 1.0.3 — 2019-05-14
- 1.0.2 — 2019-05-14

## README

Q-Router for Koa2
========

这是一个快速编写接口代码的工具 Router 库.

### 如何使用

```
npm i @leeqiang/q-router
```

```
// app.js
const app = new Koa()
const Router = require('q-router')
const router = new Router()

router.addApis('/path/to/apis', '/prefix/api')

// add prefixes
router.addApis('/path/to/apis', ['/api', ''])

app.use(router.routes)
```

> path/to/apis 这是一个目录, q-router 会检测目录下的文件, 只有符合 [Q-API](q-api.md) 格式要求即可.

### 事例
进入项目下 `example` 文件夹
```
> npm i
> node app
```

### Lisence
MIT

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