# @l-l/2dts

> api.json转为typescript的类型定义文件

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

## Install

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

Provides the command `2dts`.

## 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-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 23.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | whj1995 |
| Maintainers | whj1995 |

## Links

- npm: https://www.npmjs.com/package/@l-l/2dts
- 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/2dts

## Dependencies (3)

- [prettier](https://npm.io/package/prettier.md) ^1.17.1
- [@l-l/type](https://npm.io/package/@l-l/type.md) ^0.0.9
- [commander](https://npm.io/package/commander.md) ^2.20.0

## Recent versions

- 0.0.9 (latest) — 2019-05-22
- 0.0.8 — 2019-05-21
- 0.0.7 — 2019-05-21
- 0.0.6 — 2019-05-21
- 0.0.5 — 2019-05-21
- 0.0.4 — 2019-05-20
- 0.0.3 — 2019-05-20
- 0.0.1 — 2019-05-19

## README

# 2dts

api.json转为typescript的类型定义文件

api.json　=> typing.d.ts

## 用法

``` bash
npm install @l-l/2dts
```

1. 命令行使用

``` bash
2dts <path> <output>
```

例如:

``` bash
2dts ./api.json ./typing.d.ts
```

2. 引入包使用

``` js
const todts = require('@l-l/2dts')
const fs = require('fs');

// 读取api.json
const apiJson = JSON.parse(fs.readFileSync('xx/api.json').toString());

// 转换
const dts = todts(apiJson，{
  format: true, // 格式化
  utilType: true // 生成工具类型 
});

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

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