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.
- Host: GitHub
- URL: https://github.com/formidablelabs/ts-simplify
- Owner: FormidableLabs
- License: mit
- Created: 2023-10-17T15:55:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-23T17:59:20.000Z (over 2 years ago)
- Last Synced: 2025-09-04T17:32:50.930Z (7 months ago)
- Language: TypeScript
- Size: 104 KB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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" } };
```