# typescript-transform-aliases

> Transform aliases in TypeScript files.

Latest version **0.2.3** (published 2024-12-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install typescript-transform-aliases
pnpm add typescript-transform-aliases
yarn add typescript-transform-aliases
bun add typescript-transform-aliases
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: has types; no vulnerabilities.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2024-12-27 |
| First published | 2021-01-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | CyanSalt |
| Maintainers | cyansalt |
| Keywords | typescript, transform |

## Links

- npm: https://www.npmjs.com/package/typescript-transform-aliases
- Repository: https://github.com/CyanSalt/typescript-transform-aliases
- Homepage: https://github.com/CyanSalt/typescript-transform-aliases#readme
- Issues: https://github.com/CyanSalt/typescript-transform-aliases/issues
- npm.io page: https://npm.io/package/typescript-transform-aliases

## 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.2.3 (latest) — 2024-12-27
- 0.2.2 — 2023-04-06
- 0.2.1 — 2021-05-18
- 0.2.0 — 2021-01-24
- 0.1.0 — 2021-01-19

## README

# typescript-transform-aliases

[![npm](https://img.shields.io/npm/v/typescript-transform-aliases.svg)](https://www.npmjs.com/package/typescript-transform-aliases)

Transform aliases in TypeScript files.

## Install

```sh
npm i -D typescript-transform-aliases
# or
yarn add -D typescript-transform-aliases
```

## Usage

With [ttypescript](https://github.com/cevek/ttypescript/) or [ts-patch](https://github.com/nonara/ts-patch)

```json
{
  "compilerOptions": {
    "plugins": [
      {
        "transform": "typescript-transform-aliases",
        "after": true,
        "afterDeclarations": true,
        "aliases": {
          // for example
          "^lodash-es$": "lodash"
        }
      }
    ]
  }
}
```

## Similar packages

- [typescript-transform-paths](https://github.com/LeDDGroup/typescript-transform-paths)

- [@zerollup/ts-transform-paths](https://github.com/zerkalica/zerollup/tree/master/packages/ts-transform-paths/)

- [ts-transform-import-path-rewrite](https://github.com/dropbox/ts-transform-import-path-rewrite)

Both `typescript-transform-paths` and `@zerollup/ts-transform-paths` transform the `paths` field in `tsconfig.json`, which are usually aliases for **relative** paths;

`ts-transform-import-path-rewrite` could transform any aliases but does not support `require` or dynamic imports.

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