open-index/open-npm huggingface dataset:
npm package: @sfajs/jwt
Description: 基于 jsonwebtoken 和 @sfajs/inject 的 JWT 中间件
Author: hal-wang
Latest version: 0.3.6
Deprecated: Use @halsp/jwt

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/jwt/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/jwt.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/jwt" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/jwt/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/jwt/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/jwt/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/jwt/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/jwt"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/jwt` 是 `sfajs` 的 jwt 工具插件

基于 [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) 和 [@sfajs/inject](https://github.com/sfajs/inject)

## 安装

```
npm install @sfajs/jwt
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/jwt](https://github.com/sfajs/jwt/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/jwt/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/jwt" />
</a>

## License

@sfajs/jwt is MIT licensed.
npm package: @sfajs/koa
Description: 让 koa 成为 sfa 的中间件，并打通二者中间件管道
Author: hal-wang
Latest version: 1.1.6
Deprecated: Renamed to @ipare/koa

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/koa/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/koa.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/koa" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/koa/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/koa/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/koa/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/koa/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/koa"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

让 koa 成为 sfa 的中间件，或 sfa 成为 koa 的中间件，并打通二者中间件管道

## 安装

```
npm install @sfajs/koa
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/koa](https://github.com/sfajs/koa/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/koa/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/koa" />
</a>

## License

@sfajs/koa is MIT licensed.
npm package: @sfajs/lambda
Description: 将 sfa 托管到 serverless 云函数，如腾讯云云函数、阿里云云函数、awa lambda、azure functions 等
Author: hal-wang
Latest version: 1.3.3
Deprecated: Use @halsp/lambda

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/lambda/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/lambda.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/lambda" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/lambda/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/lambda/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/lambda/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/lambda/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/lambda"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/lambda` 是 `sfajs` 的 `serverless` 云函数托管环境

可以将 `sfajs` 项目托管到 `腾讯云事件云函数`、`阿里云事件云函数`、`aws lambda`、`azure functions` 等，提升云函数响应速度

## 安装

```
npm install @sfajs/lambda
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/lambda](https://github.com/sfajs/lambda/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/lambda/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/lambda" />
</a>

## License

@sfajs/lambda is MIT licensed.
npm package: @sfajs/mva
Description: sfajs MVA 框架
Author: hal-wang
Latest version: 1.5.2
Deprecated: Use @halsp/mva

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/mva/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/mva.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/mva" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/mva/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/mva/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/mva/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/mva/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/mva"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/mva` 是 `sfajs` 的 MVA 框架

- 支持 RESTful 规范
- 根据文件系统映射访问路径，彻底解耦无关联功能
- 轻量化，高可扩展性
- 移除 controller 层，灵活性更高

## 安装

```
npm install @sfajs/mva
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/mva](https://github.com/sfajs/mva/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/mva/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/mva" />
</a>

## License

@sfajs/mva is MIT licensed.
npm package: @sfajs/pipe
Description: sfajs 的管道插件
Author: hal-wang
Latest version: 1.3.2
Deprecated: Use @halsp/pipe

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/pipe/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/pipe.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/pipe" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/pipe/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/pipe/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/pipe/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/pipe/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/pipe"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/pipe` 是 `sfajs` 的管道插件

用于校验、转换、格式化请求参数

## 安装

```
npm install @sfajs/pipe
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/pipe](https://github.com/sfajs/pipe/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/pipe/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/pipe" />
</a>

## License

@sfajs/pipe is MIT licensed.
npm package: @sfajs/req-deco
Description: 通过装饰器便捷使用接口参数
Author: hal-wang
Latest version: 1.0.1
Deprecated: Use halsp

# @sfajs/req-deco

基于 `@sfajs/inject` 通过装饰器便捷使用接口参数

你需要使用装饰器并引入 `@sfajs/inject` 以使用此功能

用 `Query`, `Header`, `Param`, `Body`, `Context` 装饰字段，该字段在特定生命周期会被自动赋值

## 快速开始

```TS
import "@sfajs/inject";
import { Header, Query, Param, Body, Context } from "@sfajs/req-deco";
import { Middleware, ReadonlyDict, TestStartup, HttpContext } from "@sfajs/core";

class TestMiddleware extends Middleware {
  @Context
  private readonly ctx1!: HttpContext;
  @Header
  private readonly header!: ReadonlyDict;
  @Query
  private readonly query1!: ReadonlyDict;
  @Query
  private readonly query2!: ReadonlyDict;
  @Param
  private readonly params!: ReadonlyDict;
  @Body
  private readonly body!: ReadonlyDict;
  @Body("array")
  private readonly arrayFieldBody!: string;
  @Query("q")
  private readonly queryProperty!: string;

  async invoke(): Promise<void> {
    this.ok({
      header: this.header,
      query1: this.query1,
      query2: this.query2,
      params: this.params,
      body: this.body,
      arrayFieldBody: this.arrayFieldBody,
      queryProperty: this.queryProperty,
    });
  }
}

const res = await new TestStartup()
    .useInject()
    .add(TestMiddleware)
    .run();
```

上述代码中的 `useInject` 会启用依赖注入，`@sfajs/req-deco` 利用依赖注入实现功能

需要注意的是，该功能只会在 `useInject` 之后的中间件中生效，因此你需要把 `useInject` 放在靠前的位置，根据实际项目决定

## 在其他类中

在其他任意类中，你也可以利用控制反转实现实例化

```TS
import { parseInject } from "@sfajs/inject";
import { HttpContext } from "@sfajs/core";
import { Header, Query, Context } from "@sfajs/req-deco";

class TestClass {
  @Context
  private readonly ctx!: HttpContext;
  @Header
  private readonly header!: any;
  @Query("property")
  private readonly query!: any;
}

const obj = parseInject(TestClass); // 利用控制反转创建对象
// OR
const obj = parseInject(new TestClass());
```

## 避免在单例类中使用

由于每次接口请求，参数可能都会变

因此使用装饰器的类，其实例对象必须仅作用于单次网络访问

例如不能使用单例类或单例中间件，否则可能会在高并发下出现不可预知的问题

在这样的中间件中不能使用 `@sfajs/req-deco`，因为中间件是单例的：

```TS
startup.use(new YourMiddleware())
```

```TS
const md = new YourMiddleware();
startup.use((ctx) => md);
```

## 管道 pipe

利用管道可以实现参数校验、参数转换等

此处管道不同于管道上下文 `HttpContext`

### 用法

`Header`,`Query` 等装饰器参数可以接收管道对象或类

如果传入的是管道的类，可以利用控制反转自动实例化管道

传入类

```TS
import { Query, ParseIntPipe } from "@sfajs/req-deco"

@Query("field", ParseIntPipe)
queryField: number;
```

或传入对象

```TS
@Query("field", new ParseIntPipe())
queryField: number;
```

或转换整个 query

```TS
@Query(ParseIntPipe)
query: any;
```

### 内置管道

目前内置的管道有

- DefaultValuePipe: 参数为 `null`,`undefined`,`NaN` 等，赋值默认值
- TrimPipe: 去除字符串前后空白符，可单独限定 `start` 或 `end`
- ParseIntPipe: 字符串转整型
- ParseFloatPipe: 字符串转浮点数
- ParseBoolPipe: 字符串转布尔，可自定义对应值

### 自定义管道

更多需求可以自定义管道

创建一个类，实现 `PipeTransform` 接口，如

```TS
import { Context, PipeTransform } from "@sfajs/req-deco"

class ToStringPipe implements PipeTransform<any, string> {
  @Context
  readonly ctx: HttpContext;

  transform(value: any) {
    return "" + value;
  }
}
```
npm package: @sfajs/router
Description: sfajs 的路由插件
Author: hal-wang
Latest version: 2.1.5
Deprecated: Use @halsp/router

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/router/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/router.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/router" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/router/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/router/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/router/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/router/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/router"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/router` 是 `sfajs` 的路由插件

- 支持 RESTful 规范
- 根据文件系统映射访问路径，彻底解耦无关联功能
- 按需加载，提升请求速度
- 轻量化，高可扩展性
- 移除 controller 层，灵活性更高
- 预编译路由，提升启动速度和响应速度

## 安装

```
npm install @sfajs/router
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/router](https://github.com/sfajs/router/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/router/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/router" />
</a>

## License

@sfajs/router is MIT licensed.
npm package: @sfajs/static
Description: sfajs 的静态资源插件
Author: hal-wang
Latest version: 1.1.2
Deprecated: Use @halsp/static

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/static/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/static.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/static" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/static/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/static/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/static/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/static/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/static"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/static` 是 `sfajs` 的静态资源插件

- 能够返回静态资源
- 能够匹配单个文件或整个文件夹
- 可以托管静态网站

## 安装

```
npm install @sfajs/static
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/static](https://github.com/sfajs/static/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/static/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/static" />
</a>

## License

@sfajs/static is MIT licensed.
npm package: @sfajs/swagger
Description: 使用 swagger 自动生成你的 sfa 文档
Author: hal-wang
Latest version: 1.0.6
Deprecated: Renamed to @ipare/swagger

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/swagger/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/swagger.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/swagger" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/swagger/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/swagger/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/swagger/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/swagger/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/swagger"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/swagger` 是 `sfajs` 的 swagger 文档插件

基于 [swagger-jsdoc](https://github.com/Surnet/swagger-jsdoc) 生成页面

在浏览器中使用 [swagger-ui](https://github.com/swagger-api/swagger-ui) 渲染文档

## 安装

```
npm install @sfajs/swagger
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/swagger](https://github.com/sfajs/swagger/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/swagger/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/swagger" />
</a>

## License

@sfajs/swagger is MIT licensed.
npm package: @sfajs/testing
Description: sfajs 的测试工具
Author: hal-wang
Latest version: 0.0.4
Deprecated: Use @halsp/testing

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/testing/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/testing.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/testing" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/testing/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/testing/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/testing/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/testing/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/testing"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/testing` 是 `sfajs` 的测试工具

用于单元测试、本地测试等

## 安装

```
npm install @sfajs/testing
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/testing](https://github.com/sfajs/testing/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/testing/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/testing" />
</a>

## License

@sfajs/testing is MIT licensed.
npm package: @sfajs/validator
Description: sfajs 的参数校验插件
Author: hal-wang
Latest version: 0.0.4
Deprecated: Use @halsp/validator

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/validator/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/validator.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/validator" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/validator/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/validator/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/validator/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/validator/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/validator"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/validator` 是 `sfajs` 的参数校验插件

基于 [class-validator](https://github.com/typestack/class-validator) 和 [@sfajs/pipe](https://github.com/sfajs/pipe) 校验请求参数

## 安装

```
npm install @sfajs/validator
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/validator](https://github.com/sfajs/validator/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/validator/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/validator" />
</a>

## License

@sfajs/validator is MIT licensed.
npm package: @sfajs/view
Description: sfa 视图渲染中间件
Author: hal-wang
Latest version: 1.3.3
Deprecated: Use @halsp/view

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/view/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/view.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/view" alt="npm downloads"></a>
    <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
    <a href="#"><img src="https://github.com/sfajs/view/actions/workflows/test.yml/badge.svg?branch=main" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/view/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/view/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/view/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/view"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/view` 是 `sfajs` 的视图渲染插件

- 基于 `consolidate`， 支持多种视图模板，参考 [consolidate](https://github.com/tj/consolidate.js)

## 安装

```
npm install @sfajs/view
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

请阅读 [Contributing to @sfajs/view](https://github.com/sfajs/view/blob/main/CONTRIBUTING.md)

### 贡献列表

<a href="https://github.com/sfajs/view/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/view" />
</a>

## License

@sfajs/view is MIT licensed.
npm package: @sfajs/views
Description: sfa 视图渲染中间件
Author: hal-wang
Latest version: 1.1.11
Deprecated: Use @halsp/view

<p align="center">
  <a href="https://sfajs.com/" target="blank"><img src="https://sfajs.com/images/logo.png" alt="sfajs Logo" width="200"/></a>
</p>

<p align="center">sfajs - 面向云的现代渐进式轻量 <a href="http://nodejs.org" target="_blank">Node.js</a> 框架</p>
<p align="center">
    <a href="https://github.com/sfajs/views/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
    <a href=""><img src="https://img.shields.io/npm/v/@sfajs/views.svg" alt="npm version"></a>
    <a href=""><img src="https://badgen.net/npm/dt/@sfajs/views" alt="npm downloads"></a>
    <a href="#"><img src="https://github.com/sfajs/views/actions/workflows/test.yml/badge.svg?branch=2.x" alt="Build Status"></a>
    <a href="https://codecov.io/gh/sfajs/views/branch/main"><img src="https://img.shields.io/codecov/c/github/sfajs/views/main.svg" alt="Test Coverage"></a>
    <a href="https://github.com/sfajs/views/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
    <a href="https://gitpod.io/#https://github.com/sfajs/views"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
    <a href="https://paypal.me/ihalwang" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
</p>

## 介绍

`@sfajs/views` 是 `sfajs` 的视图渲染插件

- 基于 `consolidate`， 支持多种视图模板，参考 [consolidate](https://github.com/tj/consolidate.js)

## 安装

```
npm install @sfajs/views
```

## 开始使用

请访问 <https://sfajs.com>

## 贡献

`sfajs` 和 `@sfajs/views` 是免费且开源的项目，我们欢迎任何人为其开发和进步贡献力量。

- 在使用过程中出现任何问题，可以通过 [issues](https://github.com/sfajs/views/issues) 来反馈
- Bug 的修复可以提交 Pull Request
- 如果是增加新的功能特性，请先创建一个 issue 并做简单描述以及大致的实现方法，提议被采纳后，就可以创建一个实现新特性的 Pull Request
- 欢迎对说明文档做出改善，帮助更多的人使用 sfajs，文档项目：<https://github.com/sfajs/sfajs.com>
- 如果你有任何其他方面的问题或合作，欢迎发送邮件至 support@hal.wang

**提醒：和项目相关的问题最好在 issues 中反馈，这样方便其他有类似问题的人可以快速查找解决方法，并且也避免了我们重复回答一些问题。**

### 贡献列表

<a href="https://github.com/sfajs/views/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=sfajs/views" />
</a>

## License

@sfajs/views is MIT licensed.
npm package: @sfamose/angular-components
Description: a library of angular components
Author: Sandrine Famose
Latest version: 0.0.65


# AngularComponents

## Table of contents
* [Getting started](#getting-started)
* [AcDynamicFormModule](#acdynamicformmodule)


## Getting started
Install angular-components through npm:
```angular2html
npm install --save @sfamose/angular-components
```

peer dependencies : 
* @angular/cdk (>=10.0.1)
* @angular/material (>=10.0.1)
* @angular/material-moment-adapter (>=10.0.1)
* moment (>=2.24.0")

## AcDynamicFormModule
Import the acDynamicFormModule module into your app's module:
```typescript
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';
import {AcDynamicFormModule} from '@sfamose/angular-components';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    AcDynamicFormModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

Next, add the form configuration in the component
```typescript
config: AcDynamicForm = {
    fields: [
      {
        name: 'test',
        type: 'input',
        label: 'Test'
      }
    ]
}
```

Then, add the dynamic form in the template
```angular2html
<ac-dynamic-form [config]="config"></ac-dynamic-form>
```