# ts-swagger-typegen

> Generate TS types with swagger

Latest version **0.1.1** (published 2023-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-swagger-typegen
pnpm add ts-swagger-typegen
yarn add ts-swagger-typegen
bun add ts-swagger-typegen
```

Provides the command `ts-swagger-typegen`.

## 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.1.1 |
| Published | 2023-07-20 |
| First published | 2023-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Anwesh Budhathoki |
| Maintainers | anweshb |

## Links

- npm: https://www.npmjs.com/package/ts-swagger-typegen
- Repository: https://github.com/anwesh-b/ts-swagger-typegen
- Homepage: https://github.com/anwesh-b/ts-swagger-typegen#readme
- Issues: https://github.com/anwesh-b/ts-swagger-typegen/issues
- npm.io page: https://npm.io/package/ts-swagger-typegen

## Recent versions

- 0.1.1 (latest) — 2023-07-20
- 0.1.0 — 2023-07-20

## README

## TS Swagger Typegen
The package is used to generate typescript types using Swagger documentation.

### Installation
##### Step 1: Install ts-swagger-typegen
```bash
yarn add ts-swagger-typegen
```

##### Step 2: Create a configration file
Add a `typegen.config.json` with content:
```json
{
  "dev": {
    "url": "<url_to_swagger>",
    "title": "<title>",
    "location": "<location_to_save_types>"
  }
}
```

#### Step 3: Add to scripts in package json
```json
  "scripts": {
    "typegen": "ts-swagger-typegen"
  }
```

#### Step 4: Generate types
```bash
yarn typegen dev
```
> You can change `dev` to any environment as specified in `typegen.config.json`

### Best practices
- Always gitignore the type file
- Add configuration for all the environemnts
- Generate the type before development and during build process

### TODO
- Eslint configuration
- Add tests
- Generation from multiple swagger
- Service layer code

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