# dash-ast

> walk an AST, quickly

Latest version **2.0.1** (published 2020-03-11) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-03-11 |
| First published | 2018-05-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Renée Kooi |
| Maintainers | goto-bus-stop |
| Keywords | ast, estree, javascript, parse, transform, tree, visitor, walk, walker |

## Links

- npm: https://www.npmjs.com/package/dash-ast
- Repository: https://github.com/goto-bus-stop/dash-ast
- Issues: https://github.com/goto-bus-stop/dash-ast/issues
- npm.io page: https://npm.io/package/dash-ast

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-03-11
- 2.0.0 — 2020-03-11
- 1.0.0 — 2018-05-30

## README

# dash-ast

walk an AST, quickly

[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]

[npm-image]: https://img.shields.io/npm/v/dash-ast.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/dash-ast
[travis-image]: https://img.shields.io/travis/goto-bus-stop/dash-ast.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/dash-ast
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard

## Install

```
npm install dash-ast
```

## Usage

```js
var dashAst = require('dash-ast')
var isIdentifier = require('estree-is-identifier')

var deps = []
dashAst(ast, function (node, parent) {
  if (node.type === 'CallExpression' && isIdentifier(node.callee, 'require')) {
    deps.push(node.arguments[0])
  }
})
```

## API

### `dashAst(ast, callback)`

Call `callback(node, parent)` on each node in `ast`. This does a preorder traversal, i.e. `callback` receives child nodes _after_ the parent node.

### `dashAst(ast, { enter, leave })`

Call `enter(node, parent)` on each node in `ast` before traversing its children, and call `leave(enter, parent)` on each node _after_ traversing its children. If a node does not have children, `enter()` and `leave()` are called immediately after each other.

## License

[Apache-2.0](LICENSE.md)

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