# koatty_core

> Koatty framework core

Latest version **2.2.0** (published 2026-04-24) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2026-04-24 |
| First published | 2021-07-09 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 7 |
| Unpacked size | 680.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | richenlin@gmail.com |
| Maintainers | richenlin |

## Links

- npm: https://www.npmjs.com/package/koatty_core
- Repository: https://github.com/koatty/koatty_core
- Homepage: https://github.com/koatty/koatty_core#readme
- Issues: https://github.com/koatty/koatty_core/issues
- npm.io page: https://npm.io/package/koatty_core

## Dependencies (7)

- [koa](https://npm.io/package/koa.md) ^2.16.3 || ^3.1.1
- [koatty_lib](https://npm.io/package/koatty_lib.md) 1.5.0
- [koa-compose](https://npm.io/package/koa-compose.md) ^4.1.0
- [on-finished](https://npm.io/package/on-finished.md) ^2.4.1
- [koatty_logger](https://npm.io/package/koatty_logger.md) 2.9.0
- [koatty_container](https://npm.io/package/koatty_container.md) 2.1.0
- [koatty_exception](https://npm.io/package/koatty_exception.md) 2.2.0

## Recent versions

- 2.2.0 (latest) — 2026-04-24
- 1.6.2-0 (prerelease) — 2022-03-11
- 2.1.9 — 2026-03-08
- 2.1.8 — 2026-03-07
- 2.1.7 — 2026-03-02
- 2.1.6 — 2026-02-11
- 2.1.5 — 2026-02-10
- 2.1.4 — 2026-02-04
- 2.1.3 — 2026-02-04
- 2.1.2 — 2026-02-03
- 2.1.1 — 2026-02-03
- 2.1.0 — 2026-01-31
- 2.0.14 — 2026-01-28
- 2.0.11 — 2026-01-28
- 2.0.8 — 2025-11-02
- … 148 more at https://npm.io/package/koatty_core/versions

## README

# Koatty Core

[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![npm version](https://badge.fury.io/js/koatty_core.svg)](https://badge.fury.io/js/koatty_core)

Koatty框架核心模块，基于Koa的Node.js应用框架。

## 特性

- 基于Koa的轻量级核心
- 支持HTTP、gRPC、WebSocket、GraphQL多种协议
- 内置应用生命周期管理
- 强大的中间件支持（Koa + Express）
- 灵活的配置管理
- 完善的错误处理机制
- 请求追踪和性能监控
- 元数据管理

### 性能指标
根据性能测试结果：
- HTTP上下文创建：平均 < 0.1ms/个
- GraphQL上下文创建：平均 < 0.2ms/个  
- 元数据操作：平均 < 0.01ms/次
- 并发处理能力：> 10,000 ops/sec
- 内存使用：10k上下文增长 < 100MB

### 性能测试
运行性能测试：
```bash
npm test -- test/performance.test.ts
```

## API文档

详细API文档请参考: [API文档](./docs/api)

## 贡献指南

欢迎提交Pull Request或报告Issue。在提交代码前请确保:

1. 运行测试: `npm test`
2. 遵循代码风格: `npm run eslint`

## 许可证

BSD 3-Clause License

Copyright (c) 2020-present, richenlin@gmail.com

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