@rxap/json-schema-to-typescript
Version:
Generate TypeScript interfaces from JSON Schema definitions. It allows you to programmatically create and manipulate TypeScript interface definitions based on JSON schema inputs. The package provides utilities to convert JSON schema to TypeScript interfac
46 lines (36 loc) • 1.9 kB
Markdown
Generate TypeScript interfaces from JSON Schema definitions. It allows you to programmatically create and manipulate TypeScript interface definitions based on JSON schema inputs. The package provides utilities to convert JSON schema to TypeScript interfaces, handle references, and manage imports.
[](https://www.npmjs.com/package/@rxap/json-schema-to-typescript)
[](https://commitizen.github.io/cz-cli/)
[](https://github.com/prettier/prettier)



- [Installation](#installation)
- [Generators](#generators)
- [init](#init)
- [generate](#generate)
# Installation
**Add the package to your workspace:**
```bash
yarn add @rxap/json-schema-to-typescript
```
**Execute the init generator:**
```bash
yarn nx g @rxap/json-schema-to-typescript:init
```
# Generators
## init
> Initialize the package in the workspace
```bash
nx g @rxap/json-schema-to-typescript:init
```
## generate
> Generate a typescript interface for a given json schema
```bash
nx g @rxap/json-schema-to-typescript:generate
```
Option | Type | Default | Description
--- | --- | --- | ---
path | string | | Path to the json schema file
output | string | | Path to the output typescript file. Defaults to the filename of the json schema where .json is replaced by .d.ts
suffix | string | | Suffix of the generate interface name