# nest-knife4j2

> ```shell yarn add swagger-ui-express @nestjs/swagger nest-knife4j ```

Latest version **0.0.3** (published 2022-06-01) · 0 weekly downloads

## Install

```sh
npm install nest-knife4j2
pnpm add nest-knife4j2
yarn add nest-knife4j2
bun add nest-knife4j2
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-06-01 |
| First published | 2022-06-01 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Junyi |
| Maintainers | fangbao |

## Links

- npm: https://www.npmjs.com/package/nest-knife4j2
- Repository: https://github.com/fangbao-0418/nest-knife4j2
- Homepage: https://github.com/fangbao-0418/nest-knife4j2#readme
- Issues: https://github.com/fangbao-0418/nest-knife4j2/issues
- npm.io page: https://npm.io/package/nest-knife4j2

## Dependencies (1)

- [user](https://npm.io/package/user.md) ^0.0.0

## Recent versions

- 0.0.3 (latest) — 2022-06-01
- 0.0.2 — 2022-06-01
- 0.0.1 — 2022-06-01

## README

## Usage

```shell
yarn add swagger-ui-express @nestjs/swagger nest-knife4j
```


in main.ts

```typescript
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'
import { knife4jSetup } from 'nest-knife4j'


async function bootstrap(){
  ...
    
  const options = new DocumentBuilder()
    .setTitle('Cats example')
    .setDescription('The cats API description')
    .setVersion('1.0')
    .addTag('cats')
    .build()
  const document = SwaggerModule.createDocument(app, options)
  SwaggerModule.setup('api', app, document)
  knife4jSetup(app, {
    urls: [
      {
        name: '2.X版本',
        url: `/api-json`,
        swaggerVersion: '3.0',
        location: `/api-json`,
      },
    ],
  })
  await app.listen(3000)
  ...
}

```

then you can browse on  [http://127.0.0.1:3000/doc.html](http://127.0.0.1:3000/doc.html)

![示例](http://static.doveaz.xyz/screenshotexample.png)

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