# @baemingo/tscpaths-async

> Replace absolute paths to relative paths after typescript compilation

Latest version **0.0.15** (published 2019-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @baemingo/tscpaths-async
pnpm add @baemingo/tscpaths-async
yarn add @baemingo/tscpaths-async
bun add @baemingo/tscpaths-async
```

Provides the command `tscpaths`.

## 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.0.15 |
| Published | 2019-12-13 |
| First published | 2019-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 4 |
| Unpacked size | 21.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Joon Ho Cho |
| Maintainers | anton0243, hakuna9889, joarwilk, metoone, tgrade |
| Keywords | typescript, paths, alias, absolute path, relative path, compilation, tsc |

## Links

- npm: https://www.npmjs.com/package/@baemingo/tscpaths-async
- Repository: https://github.com/baemingo/tscpaths-async
- Homepage: https://github.com/baemingo/tscpaths-async#readme
- Issues: https://github.com/baemingo/tscpaths-async/issues
- npm.io page: https://npm.io/package/@baemingo/tscpaths-async

## Dependencies (4)

- [globby](https://npm.io/package/globby.md) ^10.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [commander](https://npm.io/package/commander.md) ^4.0.1
- [typescript](https://npm.io/package/typescript.md) ^3.4.5

## 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

- 0.0.15 (latest) — 2019-12-13
- 0.0.13-alpha.5 (alpha) — 2019-11-27
- 0.0.14 — 2019-11-29
- 0.0.13 — 2019-11-27
- 0.0.13-alpha.4 — 2019-11-27
- 0.0.12 — 2019-11-19
- 0.0.11 — 2019-11-19
- 0.0.10 — 2019-11-19

## README

# tscpaths
Replace absolute paths to relative paths after typescript compilation (tsc) during compile-time.

[![npm version](https://badge.fury.io/js/%40baemingo%2Ftscpaths-async.svg)](https://badge.fury.io/js/%40baemingo%2Ftscpaths-async)
[![Dependency Status](https://david-dm.org/baemingo/tscpaths-async.svg)](https://david-dm.org/baemingo/tscpaths-async)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)

## Comparison to [tsconfig-paths](https://github.com/dividab/tsconfig-paths)
\+ Compile time (no runtime dependencies)

## Getting Started
First, install tscpaths as devDependency using npm or yarn.

```sh
npm install --save-dev @baemingo/tscpaths-async
# or
yarn add -D @baemingo/tscpaths-async
```

## Add it to your build scripts in package.json
```json
"scripts": {
  "build": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./src -o ./out",
}
```

### Options
| flag         | description                                        |
| ------------ | -------------------------------------------------- |
| -p --project | project configuration file (tsconfig.json)         |
| -s --src     | source code root directory                         |
| -o --out     | output directory of transpiled code (tsc --outDir) |
| --silent     | silence the console output                         |

You need to provide -s (--src) and -o (--out), because it's hard to predict source and output paths based on tsconfig.json.

I've tried a little and failed. :(

`tsc` does some magic to determine source and output paths and I haven't dived too deep to mimic it.

For now, it's simpler to provide the paths manually.

If you know how, Pull Requests are welcome!


# Disclaimer !!!!!
This is not a mature project yet.

It works for my setup so far.

It may not work correctly if your setup is too complicated, so please do some testing before pushing it to production!!!

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