# @atomist/tree-path

> Atomist path expression support

Latest version **1.0.3** (published 2019-03-14) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @atomist/tree-path
pnpm add @atomist/tree-path
yarn add @atomist/tree-path
bun add @atomist/tree-path
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-14 |
| First published | 2017-10-11 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.1.0 |
| Dependencies | 3 |
| Unpacked size | 112.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Atomist |
| Maintainers | atomist |
| Keywords | atomist, parser, path-expressions |

## Links

- npm: https://www.npmjs.com/package/@atomist/tree-path
- Repository: https://github.com/atomist/tree-path
- Homepage: https://github.com/atomist/tree-path#readme
- Issues: https://github.com/atomist/tree-path/issues
- npm.io page: https://npm.io/package/@atomist/tree-path

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.123
- [@atomist/microgrammar](https://npm.io/package/@atomist/microgrammar.md) ^1.2.0

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

- 1.0.3 (latest) — 2019-03-14
- 1.0.4-master.20210108050742 (branch-master) — 2021-01-08
- 1.0.4-master.20190916021843 — 2019-09-16
- 1.0.4-atomist.a260p86nh.typescript-version.master.20190915194950 — 2019-09-15
- 1.0.4-atomist.anq2qhoid.typescript-version.master.20190904150344 — 2019-09-04
- 1.0.3-master.20190314225654 — 2019-03-14
- 1.0.3-master.20190314225355 — 2019-03-14
- 1.0.3-nortissej.identify-named-nodes.20190119004748 — 2019-01-19
- 1.0.2 — 2019-01-14
- 1.0.2-master.20190112001350 — 2019-01-12
- 1.0.2-nortissej.upgrade-mg.20190111225903 — 2019-01-11
- 1.0.1 — 2018-11-09
- 1.0.1-master.20181109094247 — 2018-11-09
- 1.0.0-RC.2 — 2018-10-30
- 1.0.0-master.20181030135950 — 2018-10-30
- … 35 more at https://npm.io/package/@atomist/tree-path/versions

## README

# @atomist/tree-path

[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/tree-path-ts/ba33dd78-8d0e-41a3-9556-fca70a98289b)](https://app.atomist.com/workspace/T29E48P34)
[![npm version](https://img.shields.io/npm/v/@atomist/tree-path.svg)](https://www.npmjs.com/package/@atomist/tree-path)

[Node.js][node] module `@atomist/tree-path-ts` defining trees and path
expressions.  These capabilities were created for use in
[Atomist][atomist] code transformations, including those used to
transform seed projects into new projects.

XPath-like path expressions can be executed against any implementation
of the simple `TreeNode` interface.  This is typically used to expose
ASTS: for example, those resulting from ANTLR grammars,
[microgrammars][] or a standalone parser such as the TypeScript
compiler's parser.  The ability to skip levels in navigating path
expressions (e.g., via `//`) is invaluable in ignoring irrelevant
levels of language ASTs, which tend to be noisy.

For example, find all variable names in a TypeScript file (using
TypeScript AST integration in [automation-client][]:

```typescript
const variableNames = evaluateScalarValue(
	sourceFile,
	"//VariableDeclaration/Identifier"
);
```

[microgrammars]: https://github.com/atomist/microgrammar (Atomist Microgrammar Node.js Package)
[automation-client]: https://github.com/atomist/automation-client-ts (Atomist Automation Client)

## Concepts

For more information, please read [Tree and path expression
overview](docs/PathExpressions.md).

## Support

General support questions should be discussed in the `#support`
channel in the [Atomist community Slack workspace][slack].

If you find a problem, please create an [issue][].

[issue]: https://github.com/atomist/tree-path-ts/issues

## Development

You will need to install [Node.js][node] to build and test this
project.

[node]: https://nodejs.org/ (Node.js)

### Build and test

Install dependencies.

```
$ npm install
```

Use the `build` package script to compile, test, lint, and build the
documentation.

```
$ npm run build
```

### Release

Releases are handled via the [Atomist SDM][atomist-sdm].  Just press
the 'Approve' button in the Atomist dashboard or Slack.

[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)

---

Created by [Atomist][atomist].
Need Help?  [Join our Slack workspace][slack].

[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)
[slack]: https://join.atomist.com/ (Atomist Community Slack)

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