# @l-l/swagger2dts

> swagger.yml转为d.ts类型定义文件

Latest version **0.0.9** (published 2019-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @l-l/swagger2dts
pnpm add @l-l/swagger2dts
yarn add @l-l/swagger2dts
bun add @l-l/swagger2dts
```

Provides the command `swagger2dts`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-05-22 |
| First published | 2019-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | whj1995 |
| Maintainers | whj1995 |

## Links

- npm: https://www.npmjs.com/package/@l-l/swagger2dts
- Repository: https://github.com/whj1995/l-l
- Homepage: https://github.com/whj1995/l-l#readme
- Issues: https://github.com/whj1995/l-l/issues
- npm.io page: https://npm.io/package/@l-l/swagger2dts

## Dependencies (3)

- [@l-l/2dts](https://npm.io/package/@l-l/2dts.md) ^0.0.9
- [commander](https://npm.io/package/commander.md) ^2.20.0
- [@l-l/swagger2](https://npm.io/package/@l-l/swagger2.md) ^0.0.9

## Recent versions

- 0.0.9 (latest) — 2019-05-22
- 0.0.8 — 2019-05-21

## README

# swagger2dts

swagger.yml转为d.ts类型定义文件

swagger.yml　=> typing.d.ts

## 用法

``` bash
npm install @l-l/swagger2dts
```

1. 命令行使用

``` bash
swagger2dts <path> <output>
```

例如:

``` bash
swagger2dts ./swagger.yml ./typing.d.ts
```

2. 引入包使用

``` js
const swagger2dts = require('@l-l/swagger2dts')
const fs = require('fs');

// 读取swagger.yml
const swaggeryml = fs.readFileSync('xx/swagger.yml').toString();

// 转换
const dts = swagger2dts(swaggeryml);

// 写
fs.writeFileSync('xx/typing.d.ts',  dts);
```

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