# @anansi/ts-utils

> Higher order utils for typescript

Latest version **0.3.14** (published 2026-10-18) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @anansi/ts-utils
pnpm add @anansi/ts-utils
yarn add @anansi/ts-utils
bun add @anansi/ts-utils
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

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

## Facts

| | |
|---|---|
| Version | 0.3.14 |
| Published | 2026-10-18 |
| First published | 2021-04-06 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 0 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Nathaniel Tucker |
| Maintainers | ntucker |
| Keywords | typescript, build |

## Links

- npm: https://www.npmjs.com/package/@anansi/ts-utils
- Repository: https://github.com:ntucker/anansi
- Homepage: https://github.com/ntucker/anansi/tree/master/packages/ts-utils#readme
- Issues: https://github.com/ntucker/anansi/issues
- npm.io page: https://npm.io/package/@anansi/ts-utils

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.3.14 (latest) — 2026-10-18
- 0.3.13 — 2026-10-18
- 0.3.12 — 2026-10-13
- 0.3.11 — 2026-06-21
- 0.3.10 — 2026-05-03
- 0.3.9 — 2025-12-07
- 0.3.8 — 2025-06-26
- 0.3.7 — 2024-07-28
- 0.3.6 — 2023-05-07
- 0.3.5 — 2023-03-28
- 0.3.4 — 2023-03-26
- 0.3.3 — 2023-03-24
- 0.3.2 — 2023-03-09
- 0.3.1 — 2023-03-05
- 0.3.0 — 2023-02-28
- … 10 more at https://npm.io/package/@anansi/ts-utils/versions

## README

# @anansi/ts-utils

Helpers for reading TypeScript configuration with the TypeScript compiler API.

## Installation
```
yarn add --dev @anansi/ts-utils typescript@^6
```

Requires the `typescript` JS API (TypeScript 3–6).

## Usage
```js
const { readTsConfig } = require('@anansi/ts-utils');

const { options, fileNames, errors } = readTsConfig('./', 'tsconfig.json');
```

### `readTsConfig(path = './', configName = 'tsconfig.json')`

Searches `path` and its parent directories for `configName`, then parses it, including `extends`, with `ts.parseJsonConfigFileContent`. Returns a `ts.ParsedCommandLine` (`options`, `fileNames`, `errors`, ...). Relative paths resolve against `path`.

Throws if no config file is found. Parse errors are returned in `errors`, not thrown.

TypeScript 7's `typescript` package has no JS API, so `readTsConfig` throws. Alias `typescript` to `npm:@typescript/typescript6`, and install TypeScript 7 as `"@typescript/native": "npm:typescript@^7"`.

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