ts-generate

CLI to generate TypeScript interfaces from source files.

Usage no npm install needed!

<script type="module">
  import tsGenerate from 'https://cdn.skypack.dev/ts-generate';
</script>

README

NPM Version CI codecov Dependency Status Dev Dependency Status

ts-generate

CLI to generate TypeScript interfaces from source files.

Table of Contents

Features

  • 💪 Generate TypeScript files (obviously).
  • 🚀 Configure output to match your project structure.

Installation

npm install -g ts-generate

Usage

ts-generate --help

class-to-interface [glob]

Generate interfaces from existing TypeScript classes

ts-generate class-to-interface src/entities/*.ts

Options:

Option Type Description Default
--prefix string Interface name prefix. n/a
--suffix string Interface name suffix. n/a
--fileNameCasing string Output file name casing. n/a
--outDir string Redirect output structure to the directory. n/a

Development

Clone the repo and run the following commands in the ts-generate directory:

npm install
npm link
npm run build