# @putout/traverse

> traverse ast-nodes

Latest version **16.2.0** (published 2026-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @putout/traverse
pnpm add @putout/traverse
yarn add @putout/traverse
bun add @putout/traverse
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 16.2.0 |
| Published | 2026-06-19 |
| First published | 2020-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 2 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 796 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | putout, traverse, putout-traverse |

## Links

- npm: https://www.npmjs.com/package/@putout/traverse
- Repository: https://github.com/coderaiser/putout
- Homepage: https://github.com/coderaiser/putout/tree/master/packages/traverse#readme
- Issues: https://github.com/coderaiser/putout/issues
- npm.io page: https://npm.io/package/@putout/traverse

## Dependencies (2)

- [@putout/babel](https://npm.io/package/@putout/babel.md) ^5.0.0
- [@putout/compare](https://npm.io/package/@putout/compare.md) ^19.0.0

## Recent versions

- 16.2.0 (latest) — 2026-06-19
- 16.1.0 — 2026-06-13
- 16.0.0 — 2026-01-06
- 15.0.0 — 2025-11-28
- 14.0.0 — 2025-06-01
- 13.0.0 — 2025-03-21
- 12.0.0 — 2025-02-06
- 11.1.0 — 2025-01-11
- 11.0.0 — 2024-10-26
- 10.0.1 — 2023-12-11
- 10.0.0 — 2023-12-10
- 9.0.0 — 2023-09-15
- 8.1.1 — 2023-08-26
- 8.1.0 — 2023-08-26
- 8.0.3 — 2023-08-04
- … 18 more at https://npm.io/package/@putout/traverse/versions

## README

# @putout/traverse [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/traverse.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/traverse "npm"

Traverse AST-nodes

## Install

```
npm i @putout/traverse
```

## API

### superTraverse

```js
import {template} from '@putout/engine-parser';
import {superTraverse} from '@putout/traverse';

const node = template.ast('const a = b');

superTraverse(node, {
    'Identifier'(path) {
        console.log('found identifier');
    },
    
    'throw __a'(path, {__a}) {
        console.log(__a);
    },
    
    'await __'(path) {
        console.log('found await');
    },
    'for await (__ of __) __'(path) {
        console.log('found for-of');
    },
});
```

### contains

```js
import {template} from '@putout/engine-parser';
import {contains} from '@putout/traverse';

const node = template.ast('async () => await x');

contains(node, [
    'return __',
    'throw __',
    'await __',
    'for await (__ of __) __',
]);

// returns
true;
```

## License

MIT

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