# easy-koa-router

> 遍历指定路由文件夹并按照文件名和文件夹名为路由路径

Latest version **0.0.5** (published 2018-02-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install easy-koa-router
pnpm add easy-koa-router
yarn add easy-koa-router
bun add easy-koa-router
```

## 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.5 |
| Published | 2018-02-28 |
| First published | 2017-04-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | apcan |
| Maintainers | apcan |
| Keywords | dir, files, router, koa, koa2, koa-router, easy, path, 路由, 路由辅助 |

## Links

- npm: https://www.npmjs.com/package/easy-koa-router
- Repository: https://github.com/Apcan/easy-koa-router
- Homepage: https://github.com/Apcan/easy-koa-router#readme
- Issues: https://github.com/Apcan/easy-koa-router/issues
- npm.io page: https://npm.io/package/easy-koa-router

## Dependencies (2)

- [easydir](https://npm.io/package/easydir.md) ^1.0.3
- [koa-router](https://npm.io/package/koa-router.md) ^7.1.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.5 (latest) — 2018-02-28
- 0.0.4 — 2017-08-04
- 0.0.3 — 2017-05-09
- 0.0.2 — 2017-04-28
- 0.0.1 — 2017-04-26

## README

# easy-koa-router
Traverse the specified routing folder and follow the file name and folder name as the routing path


## usage

### npm i -save easy-koa-router


## describing

require('easy-koa-router')(app, './routes',opt)
opt可传入perfix:所有路由Path前缀,dirperfix:文件夹Path前缀开关true or false ,custom:自定义文件Path前缀{文件名:前缀},index:设置根路径路由文件

需要使用自动适配perfix请以以下模板为路由文件模板(兼容原路由创建方式)

module.exports = (router) => {

  /**
  *此处写路由
  */

  return router
}


## example
```javascript
require('easy-koa-router')(app, './routes',opt)
```

## 描述

传入koa的app对象和须要遍历的路由文件夹，将针对路由文件夹内的koa-router的js文件遍历为path为文件名或文件夹名字的路由

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