# yields-traverse

> low level traverse function, inspired by $.dir.

Latest version **0.2.0** (published 2015-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install yields-traverse
pnpm add yields-traverse
yarn add yields-traverse
bun add yields-traverse
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-07-16 |
| First published | 2015-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Amir Abu Shareb |
| Maintainers | tootallnate, yields |
| Keywords | traverse, dir |

## Links

- npm: https://www.npmjs.com/package/yields-traverse
- Repository: https://github.com/yields/traverse
- Issues: https://github.com/yields/traverse/issues
- npm.io page: https://npm.io/package/yields-traverse

## Dependencies (1)

- [matches-selector](https://npm.io/package/matches-selector.md) *

## Recent versions

- 0.2.0 (latest) — 2015-07-16
- 0.1.1 — 2015-03-12

## README

# traverse

  low level traverse function, inspired by $.dir

## Installation

  Install with [component(1)](http://component.io):

    $ component install yields/traverse

## API

#### traverse(property, element, [selector|element, [length]])

Traverse using the given `property` on `element` getting elements
that match the given `selector` until `len` is reached.

if `selector` is omitted, all elements are returned.
`len` is defaulted to 1.

## Example

```js
var traverse = require('traverse');

// getting all `<p>` parents.

traverse('parentNode', el, 'p', Infinity);

// getting a single `<p>` sibling

traverse('nextSibling', el, 'p');

// traversing to an element

traverse('parentNode', el, document.body);
```

## License

  MIT

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