# kvl

> 基于express/typescript框架

Latest version **0.1.5** (published 2019-01-20) · ISC license · 0 weekly downloads

## Install

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

Provides the command `kvl`.

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-01-20 |
| First published | 2018-10-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 67.3 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | maskletter |
| Maintainers | maskletter |
| Keywords | typescript, express, nodejs, pm2 |

## Links

- npm: https://www.npmjs.com/package/kvl
- Repository: https://github.com/maskletter/Kvl
- Homepage: https://github.com/maskletter/Kvl#readme
- Issues: https://github.com/maskletter/Kvl/issues
- npm.io page: https://npm.io/package/kvl

## Dependencies (15)

- [pm2](https://npm.io/package/pm2.md) ^3.2.4
- [chai](https://npm.io/package/chai.md) ^4.2.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [mocha](https://npm.io/package/mocha.md) ^5.2.0
- [express](https://npm.io/package/express.md) ^4.16.4
- [ts-node](https://npm.io/package/ts-node.md) ^7.0.1
- [formidable](https://npm.io/package/formidable.md) ^1.2.1
- [typescript](https://npm.io/package/typescript.md) ^3.2.2
- [@types/chai](https://npm.io/package/@types/chai.md) ^4.1.7
- [@types/node](https://npm.io/package/@types/node.md) ^10.12.18
- [@types/mocha](https://npm.io/package/@types/mocha.md) ^5.2.5
- [node-notifier](https://npm.io/package/node-notifier.md) ^5.2.1
- [@types/express](https://npm.io/package/@types/express.md) ^4.16.0
- [tsconfig-paths](https://npm.io/package/tsconfig-paths.md) ^3.7.0
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) ^3.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2019-01-20
- 0.0.46 (beta) — 2018-11-29
- 0.1.4 — 2019-01-20
- 0.1.3 — 2019-01-20
- 0.1.2 — 2019-01-20
- 0.1.1 — 2019-01-17
- 0.1.0 — 2019-01-17
- 0.0.62 — 2019-01-16
- 0.0.61 — 2019-01-11
- 0.0.60 — 2019-01-07
- 0.0.59 — 2019-01-03
- 0.0.58 — 2019-01-03
- 0.0.57 — 2018-12-30
- 0.0.56 — 2018-12-30
- 0.0.55 — 2018-12-17
- … 35 more at https://npm.io/package/kvl/versions

## README

## Kvl(一个基于express/ts的Nodejs框架,"demo") 

<br>
<p align="center">
   <img src='https://maskletter.github.io/kvl-document/dist/assets/img/icon.206a2395.svg' width='400' />
</p>

<br>

基于 `express` ，兼容 `express` 所有方法及中间件，两者可并行使用，使用 `typescript` 实现，内置pm2基础服务调用，统一的全局接口错误处理回调。


<a href="https://badge.fury.io/js/kvl" title="NPM Version Badge" rel="nofollow">
   <img src="https://badge.fury.io/js/kvl.svg" alt="npm version" height="18">
</a>
<a href="https://img.shields.io/badge/node-%3E%3D6-brightgreen.svg" title="Node Limitation" rel="nofollow">
   <img src="https://img.shields.io/badge/node-%3E%3D6-brightgreen.svg" alt="npm version" height="18">
</a>
<a href="https://coveralls.io" title="coveralls.io" rel="nofollow">
   <img class="notice-badge" src="https://coveralls.io/repos/github/maskletter/Kvl/badge.svg?branch=master" alt="Badge">
</a>
<a href="https://travis-ci.org" title="travis-ci" rel="nofollow">
   <img class="notice-badge" src="https://travis-ci.org/maskletter/Kvl.svg?branch=master" alt="Badge">
</a>


👉👉👉[演示项目链接](https://github.com/maskletter/kvl-demo)
<br>

---

 * [Express(底层框架)](https://github.com/expressjs/express)
 * [Typescript(开发语言)](http://www.typescriptlang.org/)
 * [pm2(服务)](https://github.com/Unitech/pm2)
 --- 
 * [router(路由功能)](/use.html#router路由)
 * [interceptor拦截器(用于进行请求拦截)](/kvl-plugin.html#interceptor-拦截器)
 * [Validation验证器(用于数据验证)](/kvl-plugin.html#validator-数据验证器)
 * [throw(全局接口异常)](/use.html#全局异常)



<br />

#### 框架进度

<table>	
	<thead>
		<tr>
			<td align="center" width="20%">功能</td>
			<td align="center" width="40%">状态</td>
			<td align="center">说明</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td align="center">express</td>
			<td align="center">已完成</td>
			<td align="center">以express为基础</td>
		</tr>
		<tr>
			<td align="center">typescript</td>
			<td align="center">已完成</td>
			<td align="center">完整的ts配置，实现开发环境监听代码自动重启服务</td>
		</tr>
		<tr>
			<td align="center">router</td>
			<td align="center">已完成</td>
			<td align="center">模块化路由功能</td>
		</tr>
		<tr>
			<td align="center">interceptor</td>
			<td align="center">已完成</td>
			<td align="center">拦截器</td>
		</tr>
		<tr>
			<td align="center">validation</td>
			<td align="center">待完善</td>
			<td align="center">数据验证器</td>
		</tr>
		<tr>
			<td align="center">Api interface</td>
			<td align="center">未开始</td>
			<td align="center">创建api文档</td>
		</tr>
		<tr>
			<td align="center">pm2</td>
			<td align="center">已完成</td>
			<td align="center">利用pm2官方api，实现简单的pm2服务</td>
		</tr>
		<tr>
			<td align="center">throw</td>
			<td align="center">已完成</td>
			<td align="center">接口异常处理</td>
		</tr>
		<tr>
			<td align="center">cli</td>
			<td align="center">已完成,待优化</td>
			<td align="center">基于node的cmd命令行工具</td>
		</tr>
		<tr>
			<td align="center">环境配置</td>
			<td align="center">已完成</td>
			<td align="center">自定义环境变量</td>
		</tr>
	</tbody>


</table>

<br>

通过Npm 方式安装kvl，并创建服务运行
```bash
$ npm install kvl@latest -g
$ kvl init hellworld
$ cd hellworld
$ kvl dev
```
<br>



#### 基础方式使用
```typescript

import kvl from 'kvl';
import { Main ,Router, config, ValidationDone } from 'kvl';
@Router({}) 
class HelloWord{

	private msg: string = 'Hello, world'

	@config({ url: '/hello', name: 'hello', type: 'get' })
	private hello(req: Kvl.Request, res: Kvl.Response): void {
		res.end(`<h1>${this.msg}</h1>`)
	}

}
Main({
	port: 8080,
	router: [ HelloWord ],
})
```

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