An open API service indexing awesome lists of open source software.

https://github.com/formidablelabs/ts-simplify

CLI tool to compile TypeScript types into simple, alias-free primitives.
https://github.com/formidablelabs/ts-simplify

Last synced: 6 months ago
JSON representation

CLI tool to compile TypeScript types into simple, alias-free primitives.

Awesome Lists containing this project

README

          

# ts-simplify

CLI tool to compile TypeScript types into simple, alias-free primitives.

## Usage

```sh
ts-simplify [output]
```

This can be run via `npx` without installation, eg:
```sh
npx ts-simplify [output]
```

## Example

If you have a TypeScript file with exported types:
```ts
// example-types.ts
type MyType = { a: "A", b: "B", nested: Nested };
type Nested = { c:"C" };
export type MyType = Omit;
```

Running this:
```sh
ts-simplify ./example-types.ts ./example-types.d.ts
```

will output this:

```ts
// example-types.d.ts
export type MyType = { a: "A", nested: { c: "C" } };
```