# ts-dedupe

> A cli tool to move duplicated types and interfaces to a single file.

Latest version **0.3.1** (published 2021-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install ts-dedupe
pnpm add ts-dedupe
yarn add ts-dedupe
bun add ts-dedupe
```

Provides the command `ts-dedupe`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2021-04-04 |
| First published | 2021-04-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 51.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Giles Roadnight |
| Maintainers | roaders |
| Keywords | typescript, dedupe, interface |

## Links

- npm: https://www.npmjs.com/package/ts-dedupe
- Repository: https://github.com/Roaders/ts-dedupe
- Homepage: https://github.com/Roaders/ts-dedupe#readme
- Issues: https://github.com/Roaders/ts-dedupe/issues
- npm.io page: https://npm.io/package/ts-dedupe

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [ts-morph](https://npm.io/package/ts-morph.md) ^10.0.2
- [ts-command-line-args](https://npm.io/package/ts-command-line-args.md) ^1.8.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2021-04-04
- 0.3.0 — 2021-04-04
- 0.2.1 — 2021-04-03
- 0.2.0 — 2021-04-03
- 0.1.1 — 2021-04-03
- 0.0.0 — 2021-04-01

## README

# Ts-Dedupe

A cli tool to move duplicated types and interfaces to a single file.


## Features

* Moves duplicate interfaces and types to a single file
* Renames types / interfaces with the same name but different structure
* Organises imports in files
* Deletes empty files
* Creates a barrel file exporting all types in project


## Options

| Argument | Alias | Type | Description |
|-|-|-|-|
| **duplicatesFile** | **d** | string | Path of the file where duplicate types will be moved to. |
| **project** | **p** | string | Optional. Location of the tsconfig file for your project. Defaults to 'tsconfig.json' |
| **retainEmptyFiles** | **r** | boolean | If specified empty files will not be removed (may cause issues if also generating a barrel file) |
| **barrelFile** | **b** | string | Optional. If specified will generate a barrel file for all the files in your project. |
| **help** | **h** | boolean | Displays the help guide. |

[//]: ####ts-command-line-args_write-markdown_replaceAbove

## Programmatic Usage

```ts
import { dedupe } from "ts-dedupe"

dedupe({duplicatesFile: "shared-types.ts"})
```

`dedupe` takes an options object that matches the options for the cli as stated above. The only required property is `duplicatesFile` - the location to move duplicated types to.

---
_Source: https://npm.io/package/ts-dedupe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
