# typescript-paths

> Resolving tsconfig paths in runtime

Latest version **1.5.2** (published 2026-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install typescript-paths
pnpm add typescript-paths
yarn add typescript-paths
bun add typescript-paths
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2026-04-08 |
| First published | 2021-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 58.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | lightyen |
| Maintainers | lightyen |
| Keywords | typescript, tsconfig, paths |

## Links

- npm: https://www.npmjs.com/package/typescript-paths
- Repository: https://github.com/lightyen/typescript-paths
- Homepage: https://github.com/lightyen/typescript-paths/blob/main/packages/typescript-paths#readme
- Issues: https://github.com/lightyen/typescript-paths/issues
- npm.io page: https://npm.io/package/typescript-paths

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.5.2 (latest) — 2026-04-08
- 1.5.1 — 2023-05-24
- 1.5.0 — 2023-04-06
- 1.4.0 — 2022-07-25
- 1.3.1 — 2022-01-01
- 1.3.0 — 2022-01-01
- 1.2.6 — 2021-12-30
- 1.2.5 — 2021-12-26
- 1.2.4 — 2021-12-24
- 1.2.3 — 2021-12-23
- 1.2.2 — 2021-12-23
- 1.2.1 — 2021-12-21
- 1.2.0 — 2021-12-21
- 1.1.5 — 2021-10-27
- 1.1.4 — 2021-10-19
- … 11 more at https://npm.io/package/typescript-paths/versions

## README

# typescript-paths

[npm:latest]: https://www.npmjs.com/package/typescript-paths/v/latest
[npm:latest:badge]: https://img.shields.io/npm/v/typescript-paths/latest?style=flat-square

[![Latest Version][npm:latest:badge]][npm:latest]

Resolving tsconfig paths in runtime

```sh
npm install typescript-paths
```

```js
const { register } = require("typescript-paths")
register()
```

Example tsconfig.json

```json
{
  "compilerOptions": {
    "paths": {
      "~/*": ["./*"]
    }
  }
}
```

Then you can import alias instead of annoying path

```js
// const App = require("../../../../App")
const App = require("~/App")
```

## Options

### tsConfigPath _(string | string[])_

Specify the path where your TypeScript configuration file.

If not set:

- use Environment variable **TS_NODE_PROJECT**
- or search tsconfig.json in current working directory.

### logLevel _("none" | "error" | "warn" | "info" | "debug" | "trace") (default: "info")_

Set the logging level on the plugin.

### fallback _(function (string): string | undefined)_

The handler to handle unusual module name.

### color _(boolean) (default: true)_

Colorful ouput.

### respectCoreModule _(boolean) (default: true)_

## reference

- https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
- https://github.com/microsoft/TypeScript/issues/5039

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