# ast-kit

> A toolkit for easy Babel AST generation and manipulation.

Latest version **3.0.0** (published 2026-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ast-kit
pnpm add ast-kit
yarn add ast-kit
bun add ast-kit
```

## Health

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

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-06-16 |
| First published | 2023-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^22.18.0 \|\| >=24.11.0 |
| Dependencies | 3 |
| Unpacked size | 50.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 60 |
| Author | Kevin Deng <sxzz@sxzz.moe> |
| Maintainers | sxzz |

## Links

- npm: https://www.npmjs.com/package/ast-kit
- Repository: https://github.com/sxzz/ast-kit
- Homepage: https://github.com/sxzz/ast-kit#readme
- Issues: https://github.com/sxzz/ast-kit/issues
- Funding: https://github.com/sponsors/sxzz
- npm.io page: https://npm.io/package/ast-kit

## Dependencies (3)

- [pathe](https://npm.io/package/pathe.md) ^2.0.3
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^8.0.0
- [estree-walker](https://npm.io/package/estree-walker.md) ^3.0.3

## Recent versions

- 3.0.0 (latest) — 2026-06-16
- 3.0.0-beta.1 (beta) — 2026-01-19
- 2.2.0 — 2025-11-07
- 2.1.3 — 2025-10-06
- 2.1.2 — 2025-08-11
- 2.1.1 — 2025-07-01
- 2.1.0 — 2025-05-29
- 2.0.0 — 2025-05-09
- 1.4.3 — 2025-04-23
- 1.4.2 — 2025-03-05
- 1.4.0 — 2025-01-18
- 1.3.2 — 2024-12-01
- 1.3.1 — 2024-11-07
- 1.3.0 — 2024-10-14
- 1.2.1 — 2024-09-26
- … 40 more at https://npm.io/package/ast-kit/versions

## README

# ast-kit

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![JSR][jsr-src]][jsr-href]
[![Unit Test][unit-test-src]][unit-test-href]
[![codecov][codecov-src]][codecov-href]

A toolkit for easy Babel AST generation and manipulation.

[📖 API Reference](https://jsr.io/@sxzz/ast-kit/doc)

## Features

- **😇 Easy to Use**: Parse and resolve Babel AST with a straightforward API.
- **🦾 Type-Friendly**: Built in TypeScript with complete type definitions.
- **💯 Coverage**: 100% test coverage.
- **🪶 Lightweight**: Tree-shakable with only two dependencies.

## Install

```bash
npm i ast-kit
```

Requires Node.js 20.19.0 or higher.

## AST Explorer

You can explore your code's AST using the [AST Explorer](https://ast-explorer.dev/).

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
    <img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2023-PRESENT [Kevin Deng](https://github.com/sxzz)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/ast-kit.svg
[npm-version-href]: https://npmjs.com/package/ast-kit
[npm-downloads-src]: https://img.shields.io/npm/dm/ast-kit
[npm-downloads-href]: https://www.npmcharts.com/compare/ast-kit?interval=30
[jsr-src]: https://jsr.io/badges/@sxzz/ast-kit
[jsr-href]: https://jsr.io/@sxzz/ast-kit
[unit-test-src]: https://github.com/sxzz/ast-kit/actions/workflows/unit-test.yml/badge.svg
[unit-test-href]: https://github.com/sxzz/ast-kit/actions/workflows/unit-test.yml
[codecov-src]: https://codecov.io/gh/sxzz/ast-kit/graph/badge.svg?token=MHTCPNMZAK
[codecov-href]: https://codecov.io/gh/sxzz/ast-kit

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