# akjs

> koa framework

Latest version **0.2.0** (published 2023-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install akjs
pnpm add akjs
yarn add akjs
bun add akjs
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-05-25 |
| First published | 2023-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | ttghost |

## Links

- npm: https://www.npmjs.com/package/akjs
- Repository: https://github.com/tt-ghost/akjs
- Homepage: https://github.com/tt-ghost/akjs#readme
- Issues: https://github.com/tt-ghost/akjs/issues
- npm.io page: https://npm.io/package/akjs

## Dependencies (3)

- [koa](https://npm.io/package/koa.md) ^2.14.2
- [koa-router](https://npm.io/package/koa-router.md) ^12.0.0
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.4.0

## Recent versions

- 0.2.0 (latest) — 2023-05-25
- 0.1.4 — 2023-05-24
- 0.1.3 — 2023-05-24
- 0.1.2 — 2023-05-17
- 0.1.1 — 2023-05-14
- 0.1.0 — 2023-05-13

## README

# akjs

> 轻量级框架 Nodejs 框架

## 安装

```sh
npm install akjs -S
```

## 核心功能

- 规划化项目目录

```sh
├── app.js                // 入口文件
├── config                // 配置文件，与default.conf.js文件合并
│   ├── default.conf.js
│   └── dev.conf.js       // [NODE_ENV].conf.js 环境通过应用启动时传入，使用制定配置，与default.conf.js合并
├── middleware            // 中间件目录
│   ├── index.js
│   └── body-parser.js
├── module                // 业务模块，每个文件夹对应一个模块，含route\service\model
│   ├── index.js
│   └── user              // 业务模块
└── plugin
    ├── index.js
    └── validate.js
```

- 模块独立管理，如: `module/user` 对应以下文件：

```sh
├── module                // 业务模块
│   ├── index.js          // 模块聚合入口，主要子路由控制
│   └── user              // 用户模块，将Controller、Service、Model放一起管理
│       ├── index.js      // 模块路由定义
│       ├── Controller.js
│       ├── Service.js
│       └── Model.js
```

- 自定义中间件，app 为 koa 实例，所以 [koa](https://koajs.com/) 中间件均可使用
- `app.js` 示例

```js
import { Application } from "akjs";

class App extends Application {
  ready() {
    // 配置、插件、中间件、路由等加载完成后，app启动前的hook
  }
  started() {
    // app 启动后hook
  }
}

// 调用 start 启动应用
new App().start();
```

## 示例项目

[akjs-examples](https://github.com/tt-ghost/akjs-examples)

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