0.0.3 • Published 1 month ago

tstailor v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

TSTailor

Transform your JSON data into finely fitted TypeScript interfaces with TSTailor, the CLI tool that custom-tailors TypeScript definitions to match your data's shape perfectly. Say goodbye to manual typings and hello to a seamless, automated workflow that understands the nuances of your data structure.

Features

  • Automatic TypeScript Interface Generation: Convert JSON files into TypeScript interfaces with precision.
  • Configurable Output: Choose where to save your generated TypeScript interfaces and customize the interface names.
  • Deviation Reports: Generate reports highlighting inconsistencies in your data, making it easier to identify outliers and ensure data integrity.
  • CLI Simplicity: Everything you need is just a command away, making it simple to integrate into your development process.

Installation

Ensure you have Node.js installed, then run:

npm install -g tstailor

This installs TSTailor globally on your system, making it accessible from anywhere in your terminal.

Usage

Using TSTailor is as simple as running a command in your terminal. Here's the basic syntax:

tstailor <inputPath> -o <outputPath> -n <interfaceName> -r <reportPath>
  • -i, --input : Path to the input JSON file.
  • -o, --output : (Optional) Path to save the generated TypeScript interface file. Default is generatedInterface.ts.
  • -n, --interfaceName : (Optional) Name of the generated interface. Default is GeneratedInterface.
  • -r, --report : (Optional) Specify wether or not to generate the report for the interface. Default is true

Example

tstailor ./data/pokemon.json -o ./types/pokemon.ts -n Pokemon -r false

This command reads pokemon.json, generates a TypeScript interface named Pokemon in ./types/pokemon.ts, and saves a deviation report in ./reports/pokemon-report.txt.

0.0.3

1 month ago

0.0.2

2 months ago

0.0.1

2 months ago