# api-document-webpack-plugin

> ts基于babel生成api文档的 webpack插件

Latest version **1.0.1** (published 2022-06-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install api-document-webpack-plugin
pnpm add api-document-webpack-plugin
yarn add api-document-webpack-plugin
bun add api-document-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-06-02 |
| First published | 2022-06-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hinrichguo |
| Maintainers | hinrichguo |
| Keywords | webpack, webpack-plugin, ts, api |

## Links

- npm: https://www.npmjs.com/package/api-document-webpack-plugin
- npm.io page: https://npm.io/package/api-document-webpack-plugin

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-06-02
- 1.0.0 — 2022-06-01

## README

# api-document-webpack-plugin
Ts API document generation based on webpack

## Install

```shell
npm i api-document-webpack-plugin
```
## Usage

```js
const ApiDocumentWebpackPlugin = require('api-document-webpack-plugin');
module.exports = {
    mode: 'production',
    plugins: [
        new ApiDocumentWebpackPlugin({
            filePath: './api' // 接口目录或文件
        })
    ]
};

```
##### 'filePath' means Directory or file where the API interface resides 

## example

Input:

```js
interface responseData {
  code: Number;
  msg: String;
}

/**
 * @description 用户登录功能
 * @api /api/login
 * @dataType application/json
 * @requestType post
 * @returnType {code:200/400,msg:'登录成功/失败'}
 *
 */
function login(username: string, password: string): responseData {
  return {
    code: 200,
    msg: "登录成功",
  };
}

```

outPut:
## login
**description:** 用户登录功能
**api:** /api/login
**dataType:** application/json
**requestType:** post
**returnType:** {code:200/400,msg:'登录成功/失败'}
#### Parameters:
- username(string)
- password(string)

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